Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2152005imu; Fri, 14 Dec 2018 06:36:30 -0800 (PST) X-Google-Smtp-Source: AFSGD/XbBm+gFg7Vkjrrm2+nf9FAVEDoyvgn5PQLqXKa0MwuaFbqFWZVvijDtu0J5+99ydqKeeWR X-Received: by 2002:a63:e655:: with SMTP id p21mr2919690pgj.70.1544798190789; Fri, 14 Dec 2018 06:36:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544798190; cv=none; d=google.com; s=arc-20160816; b=LSdwZIE6MdBvVK3Yl9edAH2b4WZbL0phwmXJnFDdmvT36Hp2qJ6dOnt9Y7mY8gujAW cqMT4hK7k+PY4zGLlXTm+B3fP6uyWpxw01IkTpEUVoX1U/2pRrMmFjjyEdhsoLy7fKOB b4oaaJ1y3sE3efxycoiWbulcc+pqXaiTvZuuXdX73NxmOAF1HqO3ZVvR79qj/U8hvZ0A 6XHlfvI3c5DfNEUf+EGjAvormEFBr4ijh8QsrsGN762EOgEBg9yqqm5MSiYL0SvVM3V8 aLuoKpTji/BV8RoosNu90ick4irNpiTY5D6fs0sc6y2EX4RBjN9ZBt6DeuxpYzNMFiPm 3Otw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=FMgXFm/rRO6gaes71rbchB5oOTyNj1IYboe7Uczq2eU=; b=s7i5UfP76yk9om8VlS6rk1HiaAWCo0p9VL7kqHcb1NRU5dUGOq2nYJ+4o4E758Pu4z CO39xFyKO31gSqJ+O4YObAYHdQWvbpXUW+Am+JQLK+/xQMesD81ggz9pZy629yuZkQpo nR1d4lW02bqcSQUNtAPmwo5FOS5ysQZ3RQdgx8np3WevhsoJR4Ds/9UV9+3v5qk7vyNI yiZRuTeUavFLgaFC8x+c9he5ifKZqa4QWkwefULer0IMuOlPip6ULJbZg16pFh7RYFd3 48KHvvnTq7m7Y/aR5BGfpuFJUaeKFSBSlT4YY9KYjSSG9LBF1vJX4A9+TUegn4rixPTd bSLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=V2wPt5bU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 14si4128051pgo.511.2018.12.14.06.36.03; Fri, 14 Dec 2018 06:36:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=V2wPt5bU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730136AbeLNOeG (ORCPT + 99 others); Fri, 14 Dec 2018 09:34:06 -0500 Received: from mail-oi1-f193.google.com ([209.85.167.193]:36397 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729731AbeLNOeG (ORCPT ); Fri, 14 Dec 2018 09:34:06 -0500 Received: by mail-oi1-f193.google.com with SMTP id x23so4701997oix.3 for ; Fri, 14 Dec 2018 06:34:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=FMgXFm/rRO6gaes71rbchB5oOTyNj1IYboe7Uczq2eU=; b=V2wPt5bUwXqnvzs31xGj2MrPI+XxhIUzteHmi6Oqb60Y0tTQY4Cbzxj+KVvzFxkklM eNNrxoWQYUYRuJw5i3zPl8KJfiJ1oYW7CFbIEMcdd5n7rQ6odxGaL6eVnULBVaS0hVp1 wzqwncglY2NjV+LYVflwHi2Fcf7tONEDeNnDU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=FMgXFm/rRO6gaes71rbchB5oOTyNj1IYboe7Uczq2eU=; b=JpCzVuOq6ogdZpoinNQmNNv06d1g0L0OTbEDMKKyTL6g/14JT/CQsp/kh7YjN0T62T 1Tzo1XF0pYuPSMF2jdfOoLRI8j4qZ15ylk9HFi9otn5rRbvstiNMaN6F0FxLLL90CvAB 78qGEzJMXQf9hEH8JkrF/0ROLoaYD0u6zYS712Lxs4b0fNuhvGj3YWOt96tAiLnCbIvk k/b4yRoevNpXYyRE1dsa7uYCxq9vuBOMuY8BBMCKH+jb9rRBU8urPIlBNtbqEKOi2tFf CgIOZRXeOjLD5ZmcRaxJIHRkbdabnMzBMu1gbObHOtFtBFvBIur8hV4NLg1DEBAdM6oK wppQ== X-Gm-Message-State: AA+aEWaYI+qr0gvL7XngLgXZ3PiMWCLA1Q2JT0ZxtH0TTEY8aZVRL9Sd ndWqKm480sMGpC6OnaQKWreZ3xJTbEXZ07HgzHOPbA== X-Received: by 2002:aca:bcc6:: with SMTP id m189mr1951162oif.337.1544798045123; Fri, 14 Dec 2018 06:34:05 -0800 (PST) MIME-Version: 1.0 References: <1544782537-13377-1-git-send-email-gengdongjiu@huawei.com> In-Reply-To: From: Peter Maydell Date: Fri, 14 Dec 2018 14:33:53 +0000 Message-ID: Subject: Re: [RFC RESEND PATCH] kvm: arm64: export memory error recovery capability to user space To: James Morse Cc: gengdongjiu , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , Jonathan Corbet , Christoffer Dall , Marc Zyngier , Catalin Marinas , Will Deacon , kvm-devel , "open list:DOCUMENTATION" , lkml - Kernel Mailing List , arm-mail-list Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 14 Dec 2018 at 13:56, James Morse wrote: > > Hi Dongjiu Geng, > > On 14/12/2018 10:15, Dongjiu Geng wrote: > > When user space do memory recovery, it will check whether KVM and > > guest support the error recovery, only when both of them support, > > user space will do the error recovery. This patch exports this > > capability of KVM to user space. > > I can understand user-space only wanting to do the work if host and guest > support the feature. But 'error recovery' isn't a KVM feature, its a Linux > kernel feature. > > KVM will send it's user-space a SIGBUS with MCEERR code whenever its trying to > map a page at stage2 that the kernel-mm code refuses this because its poisoned. > (e.g. check_user_page_hwpoison(), get_user_pages() returns -EHWPOISON) > > This is exactly the same as happens to a normal user-space process. > > I think you really want to know if the host kernel was built with > CONFIG_MEMORY_FAILURE. Does userspace need to care about that? Presumably if the host kernel wasn't built with that support then it will simply never deliver any memory failure events to QEMU, which is fine. The point I was trying to make in the email Dongjiu references (https://patchwork.codeaurora.org/patch/652261/) is simply that "QEMU gets memory-failure notifications from the host kernel" does not imply "the guest is prepared to receive memory failure notifications", and so the code path which handles the SIGBUS must do some kind of check for whether the guest CPU is a type which expects them and that the board code set up the ACPI tables that it wants to fill in. thanks -- PMM