Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2037776pxb; Mon, 22 Feb 2021 18:38:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJzQ8iPzLA5+GQk7HpCp+Ov9Z1JSBjWZHS8vKicPKFOM1FDAhd4gv18Rj0Z0xVIv2jRPCZ5l X-Received: by 2002:a50:f9c6:: with SMTP id a6mr731658edq.240.1614047911275; Mon, 22 Feb 2021 18:38:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614047911; cv=none; d=google.com; s=arc-20160816; b=wIg1VFoq/PvU9RV1nlkD6rfE8cy4Qz24dwakWPfnCNg+S6benH+QTNAPLKlmh9GCuS J+bPuFtKQ5zpoHfyesZvMeenOIddR6Y8OoJUeBaKSnkQHu5c7rMvwXCt3Xi5P5/XvLV+ CXdsCDSonUn+ofExvgholSPUUKArMcZmIxqvvjeTOSVdqVwIYrpTL4QGUbWo5kG5aWl/ UnKOgv35t+xZTFjRsZ1TiEXijXwS3VQEAAICTasD48aWcjMtVh4cdueO1Kb5LEY3wsRM xPJ+XkG3uZesesdRvNMqPLGDYyk35EvSFviocLvOJAF7fnLIH9LxP+g1WVKAGXmyw7fg EXZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=nR/uqtz3z02Cuyg0JMm4ud61lAptX+zfuhsdO2y3GjE=; b=YjHCydjFpqvImWH/h2QnLbQ/HY6X17I1sE8c+0QH9KgTnN8cFBZmFW2R9BuRpA9YG0 OUZgyX5yRUuL+3X9dmsMUUnzl/SlbKIjlB4GlhnErxOXq8vOdFwBF5hLaBrSi+M1E2HN Vd3l222q9wNAi44O6MHN6Ar4Aq0P4xxy16lfPyRMi6C46/J2Zwje1ntQ7HVXxvYQwYtT 6KcQ+jTP2tpFOaaNuTPtIwVKB6AZASTNTkt4yczWPsNFdVKujoJomQ3MM6cjWlPSw01c d3uHp2E8AYP13n5UFfvDlH0C/OuL0a8YXChIIbNEcev0br/YJw2vOcZMCXdTD5reFgBB 6H1w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n4si11826969ejz.678.2021.02.22.18.38.07; Mon, 22 Feb 2021 18:38:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230227AbhBWC2q (ORCPT + 99 others); Mon, 22 Feb 2021 21:28:46 -0500 Received: from mail.kingsoft.com ([114.255.44.145]:12074 "EHLO mail.kingsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230166AbhBWC2q (ORCPT ); Mon, 22 Feb 2021 21:28:46 -0500 X-AuditID: 0a580157-f21ff7000005df43-56-603461f427ae Received: from mail.kingsoft.com (localhost [10.88.1.32]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.kingsoft.com (SMG-1-NODE-87) with SMTP id 97.10.57155.4F164306; Tue, 23 Feb 2021 10:01:24 +0800 (HKT) Received: from alex-virtual-machine (172.16.253.254) by KSBJMAIL2.kingsoft.cn (10.88.1.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Tue, 23 Feb 2021 10:27:56 +0800 Date: Tue, 23 Feb 2021 10:27:55 +0800 From: Aili Yao To: Borislav Petkov CC: , , , , , , , , Subject: Re: [PATCH v2] x86/mce: fix wrong no-return-ip logic in do_machine_check() Message-ID: <20210223102755.13cbdffd@alex-virtual-machine> In-Reply-To: <20210222124550.GB10880@zn.tnic> References: <20210222115007.75b7de9b@alex-virtual-machine> <20210222092403.GA29063@zn.tnic> <20210222173109.7b7ac42a@alex-virtual-machine> <20210222100356.GB29063@zn.tnic> <20210222180819.3998fe33@alex-virtual-machine> <20210222102206.GC29063@zn.tnic> <20210222192146.76ffec84@alex-virtual-machine> <20210222201723.0fcec589@alex-virtual-machine> <20210222122241.GA10880@zn.tnic> <20210222203549.0e54c26f@alex-virtual-machine> <20210222124550.GB10880@zn.tnic> Organization: kingsoft X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [172.16.253.254] X-ClientProxiedBy: KSBJMAIL1.kingsoft.cn (10.88.1.31) To KSBJMAIL2.kingsoft.cn (10.88.1.32) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrALMWRmVeSWpSXmKPExsXCFcGooPsl0STBYMZTFovPG/6xWUzbKG5x 4VQDk8XlXXPYLC4dWMBksXnTVGaLNxfusVj82PCY1YHD43trH4vH4j0vmTw2repk83h37hy7 x/t9V9k8Pm+S8zjR8oU1gD2KyyYlNSezLLVI3y6BK6Oh/SZzQS9vxezvfg2M87m6GDk5JARM JNpvXmTtYuTiEBKYziTx8fcbdgjnFaPEyjNLmEGqWARUJTbu7GMCsdmA7F33ZrGC2CICShJf F81lAmlgFrjDKPGnZxpQAweHsECoxJJphSA1vAJWEn8aDjOC2JwCuhKNs9cwQyy4xyzx7cYe dpAEv4CYRO+V/0wQJ9lLtG1ZxAjRLChxcuYTFhCbWUBH4sSqY8wQtrzE9rdzwGwhAUWJw0t+ sUP0Kkkc6Z7BBmHHSiyb94p1AqPwLCSjZiEZNQvJqAWMzKsYWYpz0w03MUIiJXwH47ymj3qH GJk4GA8xSnAwK4nwst01ShDiTUmsrEotyo8vKs1JLT7EKM3BoiTOK+bIlyAkkJ5YkpqdmlqQ WgSTZeLglGpgYl+0MLf1VurJf22v2786ZE1KyO5kWLTu4Q4R+2VMnXo/7TjkauumeTS2uvXK eD+8aJKRnKDgyysb7TWxt/Xf1WvlKw7OvjBZZs+amIM6kt8ZjnX+2v9nz8pvR17stUzombxB X29KqPu6XqvsRSlnlWRWyWrP3NQeuTez4Yu+zrwLmcpLL3U/evApk/Hbx0dXN13jXPTP10lP +5zDSbG9tt9SNkWeyv0UNUV3qtKNV2en+/GXXri9+fdOPg/nLnHvW5ve9E+OvHBopsCt5Ks7 Pe09L53hqa+92C7jUXxx1cJ727j1Cv9cXhlqJPv80I2r1tY8DJrLJvzSFlgkZLRLqlph8fza qXPPPLbpWGo4+40SS3FGoqEWc1FxIgBrJabIAwMAAA== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 22 Feb 2021 13:45:50 +0100 Borislav Petkov wrote: > On Mon, Feb 22, 2021 at 08:35:49PM +0800, Aili Yao wrote: > > Guest VM, the qemu has no way to know the RIPV value, so always get it > > cleared. > > What does that mean? > > The guest VM will get the MCE signature it gets from the host kernel so > the host kernel most definitely knows the RIPV value. When Guest access one address with UE error, it will exit guest mode, the host will do the recovery job, and then one SIGBUS is send to the VCPU and qemu will catch the signal, there is only address and error level no RIPV in signal, so qemu will assume RIPV is cleared and inject the error into guest OS. > It looks like you're testing how guests will handle MCEs which the host > has caught and wants to inject into the guest for further handling. What > is your exact use case? Please explain in detail how I can reproduce it > step-by-step locally. Yeah, there are multiple steps i do: 1. One small test code in guest OS access one address A which will be injected UC error, the address will be logged, and use vtop you can get the guest physical address. 2. Using "virsh qemu-monitor-command guest --hmp gpa2hvagpa2hva 0xxxxxx" to get the user virtual address, 3. Using vtop you can get host physical address from the above user address. 4. Inject 0x10 level error using einj module. 5. then when guest access the address, you will see what happens. Please using latest upstream kernel for guest OS, and you may change monarch_timeout to a bigger value, or you will see other issues not only talked one. Tks Best Regards! Aili Yao