From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A6547C4332F for ; Fri, 10 Nov 2023 19:24:30 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r1X6N-0002a3-G7; Fri, 10 Nov 2023 14:23:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r1X6L-0002Zf-Sx for qemu-devel@nongnu.org; Fri, 10 Nov 2023 14:23:33 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r1X6I-0005fJ-3e for qemu-devel@nongnu.org; Fri, 10 Nov 2023 14:23:33 -0500 Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3AAHiQrv023279; Fri, 10 Nov 2023 19:22:59 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=content-type : message-id : date : subject : to : cc : references : from : in-reply-to : mime-version; s=corp-2023-03-30; bh=VT1IaNr0X5Ly5RbiRuJyR9Q0ZiP1qgsus7bBLMSN1Io=; b=mB5/JCHSpqcwAalWJjZvFY5Ccu+WWvH8h4TU5mD1wdBwYag1zMKbZ69JQ0uo33qcMv0M JJSrxPqq2lbdgZgnjAi+6u/UtomhWWP5xD1NLg7p8JX1MeNK/na5U3oCUAC/h8i09+iB pU/sLoHcXkoaFqn/RchVDBoe7vwiteiD31uzLaxQY5l29wZjMkdWOgq/ker2b8DyAbaE /BdTNEIZ3SnQQMhhfVgdC9XgLVOZ8N/KLPavXK9GYpz3K37ZYHDHyjLEgCc/t/MPHs/C wqYemKNPu9pk1Os6UCzHj84Qa9dt/nKRIHHBe+mVGfUrLIkWKWreasAXYsVndSQRjugg YQ== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3u7w216wmy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Nov 2023 19:22:58 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 3AAIPgHj024983; Fri, 10 Nov 2023 19:22:58 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2100.outbound.protection.outlook.com [104.47.55.100]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3u9fr77fwy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Nov 2023 19:22:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CCTYGLkfkoJmugrYIWPrtdBPb/lkz0uwcGrc13fTN9qVwJtJzADUuvULPynv1SdCkTt6iEDznaJULsdws9lsOPQwpzJczlksFJPd+XC2fxnDB6dw74EzqMjiUSquiN7LOr61JxljhV8mdJMCxlQKi1FgvbCkdlrcW6RyD4iVUl0Qx47+H3m90zc23QXPuTjsE9qoKV5NDnZALgS54xu6osLYk0ExCCyMQxpTIFgRz5O+/69n9ML900lSNIj4CIr95hpU1zhXnmlMP6F0EQwgD5KirTBHUWiwDe7JwqXu1+yH2ME2LcB4dXKWSL5VuA6xm6VU+MYUboU+1eyAQePOVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=VT1IaNr0X5Ly5RbiRuJyR9Q0ZiP1qgsus7bBLMSN1Io=; b=A2zzTr7YfhYpd75ZNxinu030y2DBKlZ6ZlRVIqrldTLMSR3Ocjw+uoVXwb3WCzC5/vxzm+3yw8XxmydM0FJq4SndoFclBsf0rp2Zdf4/r/LGjNF+v+iEGLjYGq1IPk7RDbi/1URXHeWWqHIrefZr7l3Zxb8arL0+cd/wvIu2LI58wWa79IyVdpIgj1HLW95eohX+wh3fq5yFfuCDfyURgF2eELxo2bjvpO3OBuV5kWlHBJA/xpPIxEChteRPzGLJJUy+HLcF4uASTw6MqhAn4fCuLrrkU//VPchyvGPW99qU6yFEGt0lMkUTlQaz4c45fRZq59U1k9oy7/ottdU1Fw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VT1IaNr0X5Ly5RbiRuJyR9Q0ZiP1qgsus7bBLMSN1Io=; b=zEnyYi0z1fAW35djgR5T0hr9MHG0WBDFHB5eMGqmNur8q/Wnyz/vmbyDk2syd/DnxBD5TMFFgMSC91OMHzJg6pRMHkV9IELAYPctW1tClFdTG2Txek7aMtjKmRtXo1TFRwCw7Dug7tk2xLyWUDw1MNa26T61JP2Xnv9WLQ9/Vv4= Received: from PH0PR10MB5481.namprd10.prod.outlook.com (2603:10b6:510:ea::5) by SA2PR10MB4476.namprd10.prod.outlook.com (2603:10b6:806:f9::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.19; Fri, 10 Nov 2023 19:22:55 +0000 Received: from PH0PR10MB5481.namprd10.prod.outlook.com ([fe80::448a:a2fe:44f7:3e90]) by PH0PR10MB5481.namprd10.prod.outlook.com ([fe80::448a:a2fe:44f7:3e90%4]) with mapi id 15.20.6977.019; Fri, 10 Nov 2023 19:22:55 +0000 Content-Type: multipart/alternative; boundary="------------HwKxFBMtz3PUrQYhSERwJR0D" Message-ID: <43bea81c-cb7d-44e9-a9b9-3f059faf472e@oracle.com> Date: Fri, 10 Nov 2023 20:22:45 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 2/2] migration: prevent migration when a poisoned page is unknown from the VM Content-Language: en-US, fr To: Peter Xu Cc: qemu-devel@nongnu.org, lizhijian@fujitsu.com, pbonzini@redhat.com, quintela@redhat.com, leobras@redhat.com, joao.m.martins@oracle.com, lidongchen@tencent.com References: <20230920235301.1622672-1-william.roche@oracle.com> <20231013150839.867164-1-william.roche@oracle.com> <20231013150839.867164-3-william.roche@oracle.com> From: William Roche In-Reply-To: X-ClientProxiedBy: SI2PR02CA0048.apcprd02.prod.outlook.com (2603:1096:4:196::23) To PH0PR10MB5481.namprd10.prod.outlook.com (2603:10b6:510:ea::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR10MB5481:EE_|SA2PR10MB4476:EE_ X-MS-Office365-Filtering-Correlation-Id: f1c9b179-d05d-40f6-d878-08dbe22270eb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: p/dWtKdU6bWqlaJZTATKYwoV8Tm3FQAS6sr/mDCdEpd+0qANcgjftOb+tVxw0M+KOuhM5kur54LolCfVeFwsA7Mdu93QbzEbFY3wrs3V3ll0Ag7c6YUjoDbwYakTA1PXo40Ouy+NUpvdZ7NVsnZP4njqdWTlzTDseHhf8Z02pUNpTZeo74CzTave9noGv23NUDJnQWmE7XaobUtBYAKiy6XRNVLa29XAldZLDCQecdv8QXxaWlqVP3JsH1gnPypfIBGqDiN078c0SNM5Dpxtjs5Bkvo0Wt1TcEqKtkmjBsrCzL/8HGKajrASaBN3at3Cnc7QvFHJ3T7gIPVgydKiAcCUNyx8pDpPTDXrdTGmAqdNZuhDhGwO9TwqwRDOKGHzVFTj0fMocYFyy0rVR08+Yk2v4WTXWM3rGjrkzrG5dvLMlGZUuu3fwZG8mP86TvFv5m7o/PcJjEP9jh1tbt0qAltG+hR17v01DViRc/tJbHtuo7+o3mW8bWuFyzt4Heai5bUjpGwF2hLsyZhKvZr+fLdXTLlDIt8Cxgx4zcEICbg3dOMtdNxlkD+DY8ceUqOfbLkmLZcax2qDTeJNZeEjc9Pl2URRnLWHiVwIeJyUPEovrZAElABFdz9XZx03P2BimAtqrb5WHYtGZXhH+Z8rjA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR10MB5481.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366004)(396003)(376002)(39860400002)(346002)(136003)(230922051799003)(64100799003)(451199024)(186009)(1800799009)(36756003)(66899024)(8676002)(44832011)(4326008)(8936002)(2906002)(31696002)(86362001)(41300700001)(6512007)(26005)(53546011)(31686004)(6506007)(6666004)(5660300002)(33964004)(478600001)(6486002)(2616005)(83380400001)(66476007)(66946007)(66556008)(38100700002)(316002)(6916009)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?dE03NTVa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btc1plWkpwT2J4Y1dLVzZsU2sveWhp?= =?utf-8?B?UzlJVHFQSFM1OUZiQ1BVcHdVcmdWRjI1SURjN3hNRkYxakpMelVmYjBLVDBT?= =?utf-8?B?alJLUTZ0a0ZZbmhvQ0FRRUd3eGVSRVNHTG00THZvNHM5eXhrTmRBNXNaU09K?= =?utf-8?B?NVFpTlVNOER1UXU5eXdaR3RUb081YjJiM3ZlNTdMV0tRNkRCQ3NnMUhVWHla?= =?utf-8?B?V3hNbHVzNExkRUZXT3JyY2VWS1RFblp1OEdpNzRmUXEvTUVXUFkzQ1dQUFAx?= =?utf-8?B?OCtlYUovUUU3bFVyUG5zSmk3NEFsRjFsSjNtczhTNGNpc09WbDloSWpuWlpN?= =?utf-8?Q?FNiwhYft3sjs9YeTjXx79H78E?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: upnNpWF0y/yq2yERBDEjLbzszbID8J2KDwXZzhXKBLNoE385vuAoMyl7mnjoqedc2bV51y8eOEPNS5Kd+ibgIegBNxCsP7/HWWx7B98kef/+FTt5TSmXDodsgwkdoMf9PyeFyxLRtLHBF4m1gInoAIalaERPf5RTSr/71+or0t0UPKeCWXcgfUIQQcy/0zNNjj7reUELT+ow2nano3M7KVK7o7TtagL7e7rGofLf+J+36Pu/qBxY6gTyBjs60sGa3uy+Y6wfpzKdi023jrxUyc871oxEs4Qtr7vp8ae4wD+LV6vJaUgeAUrAMOLNsqfDDKH314QiMDbO6mezE0Sq+469AmFy25iXxzUWeFnvoTU3z8a1wmF5HT+catgsxZBSPOKnG35feDdnbRCENSuoG2MTFks9yDfdZMwdO3+SSOUxZ0tLQ2eUEE0cRY1ftokRqEciX0568qCXd+yBnXBNTg/GZT0yH4Cj9ws5fRGGj0rCbvdc//+jp+DPiCwJZV9AR1mxVTJHTqI7cTS+Z/qdA1SHE8yLRATu3R4BCYi65Ucf5++xEaNP6RRl1g2uiNnZ/R/Gy9t7xj2tB3HvriWj54b/ZwWDyBpM7kVHr6tMvA5DjwdHXdLGus9YB7m5Nkonw9QkasHUZKOx6VxPe1lRdSKRKJZZjzEy01pQgNpb6iF0kyTUK8JFfnHjzlgkRuDtB+UcVWsYlqwMvUi5qCz5HIPbMvHU3ATDt/nsh82GCLEDdR9lVL1ji+xJ5IHtaWK0kohP4c14+AuxxLSlrEpvItvH+rxQbGrxb9K2XsW2rOyrAonlLbUNf5M/Cuvng0+uqEY0G6FA7ilpIUaIeFtCIg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: f1c9b179-d05d-40f6-d878-08dbe22270eb X-MS-Exchange-CrossTenant-AuthSource: PH0PR10MB5481.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2023 19:22:55.5580 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: nTmEpoVIGBfn2Ku0uSxaakc60K0jqfkAbAC3ILSuOnpN1Y4FdSuwM+075N9CtvJyx1WeBfbo9pDEL8IypkmQpn+ujpaEnApojChP2BoXAVE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR10MB4476 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-11-10_17,2023-11-09_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 adultscore=0 mlxscore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311060000 definitions=main-2311100162 X-Proofpoint-GUID: q0EucTmyatttRAzKl6C-1_lzLzYYPBXe X-Proofpoint-ORIG-GUID: q0EucTmyatttRAzKl6C-1_lzLzYYPBXe Received-SPF: pass client-ip=205.220.177.32; envelope-from=william.roche@oracle.com; helo=mx0b-00069f02.pphosted.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org --------------HwKxFBMtz3PUrQYhSERwJR0D Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 11/8/23 22:45, Peter Xu wrote: > On Mon, Nov 06, 2023 at 10:38:14PM +0100, William Roche wrote: >> But it implies a lot of other changes: >>     - The source has to flag the error pages to indicate a poison >>       (new flag in the exchange protocole) >>     - The destination has to be able to deal with the new protocole > IIUC these two can be simply implemented by migrating hwpoison_page_list > over to dest. You need to have a compat bit for doing this, ignoring the > list on old machine types, because old QEMUs will not recognize this vmsd. > > QEMU should even support migrating a list object in VMSD, feel free to have > a look at VMSTATE_QLIST_V(). This is another area that I'll need to learn about. >>     - The destination has to be able to mark the pages as poisoned >>       (authorized to use userfaultfd) > Note: userfaultfd is actually available without any privilege if to use > UFFDIO_POISON only, as long as to open the uffd (either via syscall or > /dev/userfaultfd) using UFFD_FLAG_USER_ONLY. > > A trick is we can register with UFFD_WP mode (not MISSING; because when a > kernel accesses a missing page it'll cause SIGBUS then with USER_ONLY), > then inject whatever POISON we want. As long as UFFDIO_WRITEPROTECT is not > invoked, UFFD_WP does nothing (unlike MISSING). > >>     - So both source and destination have to be upgraded (of course >>       qemu but also an appropriate kernel version providing >>       UFFDIO_POISON on the destination) > True. Unfortunately this is not avoidable. > >>     - we may need to be able to negotiate a fall back solution >>     - an indication of the method to use could belong to the >>       migration capabilities and parameters > For above two points: it's a common issue with migration compatibility. As > long as you can provide above VMSD to migrate hwpoison_page_list, marking > all old QEMU machine types skipping that, then it should just work. > > You can have a closer look at anything in hw_compat_* as an example. Yes, I'll do that. >>     - etc... > I think you did summarize mostly all the points I can think of; is there > really anything more? :) Probably some work to select the poison migration method (allowing a migration transforming poison into zeros as a fall back method if the poison migration itself with UFFDIO_POISON can't be used, or not) for example. > It'll be great if you can, or plan to, fix that for good. Thanks for the offer ;) I'd really like to implement that, but I currently have another pressing issue to work on. I should be back on this topic within a few months. I'm now waiting for some feedback from the ARM architecture reviewer(s). Thanks a lot for all your suggestions. --------------HwKxFBMtz3PUrQYhSERwJR0D Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
On 11/8/23 22:45, Peter Xu wrote:
On Mon, Nov 06, 2023 at 10:38:14PM +0100, William Roche wrote:
But it implies a lot of other changes:
    - The source has to flag the error pages to indicate a poison
      (new flag in the exchange protocole)
    - The destination has to be able to deal with the new protocole
IIUC these two can be simply implemented by migrating hwpoison_page_list
over to dest.  You need to have a compat bit for doing this, ignoring the
list on old machine types, because old QEMUs will not recognize this vmsd.

QEMU should even support migrating a list object in VMSD, feel free to have
a look at VMSTATE_QLIST_V().

This is another area that I'll need to learn about.

    - The destination has to be able to mark the pages as poisoned
      (authorized to use userfaultfd)
Note: userfaultfd is actually available without any privilege if to use
UFFDIO_POISON only, as long as to open the uffd (either via syscall or
/dev/userfaultfd) using UFFD_FLAG_USER_ONLY.

A trick is we can register with UFFD_WP mode (not MISSING; because when a
kernel accesses a missing page it'll cause SIGBUS then with USER_ONLY),
then inject whatever POISON we want.  As long as UFFDIO_WRITEPROTECT is not
invoked, UFFD_WP does nothing (unlike MISSING).

    - So both source and destination have to be upgraded (of course
      qemu but also an appropriate kernel version providing
      UFFDIO_POISON on the destination)
True.  Unfortunately this is not avoidable.

    - we may need to be able to negotiate a fall back solution
    - an indication of the method to use could belong to the
      migration capabilities and parameters
For above two points: it's a common issue with migration compatibility.  As
long as you can provide above VMSD to migrate hwpoison_page_list, marking
all old QEMU machine types skipping that, then it should just work.

You can have a closer look at anything in hw_compat_* as an example.

Yes, I'll do that.


      
    - etc...
I think you did summarize mostly all the points I can think of; is there
really anything more? :)

Probably some work to select the poison migration method (allowing a
migration transforming poison into zeros as a fall back method if the
poison migration itself with UFFDIO_POISON can't be used, or not) for
example.

It'll be great if you can, or plan to, fix that for good.

Thanks for the offer ;)
I'd really like to implement that, but I currently have another pressing
issue to work on. I should be back on this topic within a few months.

I'm now waiting for some feedback from the ARM architecture reviewer(s).

Thanks a lot for all your suggestions.

--------------HwKxFBMtz3PUrQYhSERwJR0D--