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 C1B67C47088 for ; Thu, 1 Dec 2022 11:01:26 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p0hIu-0003KZ-JY; Thu, 01 Dec 2022 06:00:32 -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 1p0hIs-0003KB-RN for qemu-devel@nongnu.org; Thu, 01 Dec 2022 06:00:31 -0500 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p0hIo-0006cY-GF for qemu-devel@nongnu.org; Thu, 01 Dec 2022 06:00:30 -0500 Received: by mail-pj1-x1029.google.com with SMTP id e7-20020a17090a77c700b00216928a3917so4849123pjs.4 for ; Thu, 01 Dec 2022 03:00:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=3m5F5SZmhCySHaq4Kl+nNPgZPVM9ttm1TTYlw+maT9E=; b=BkcdZqbFeePP7PhgiNGQZiQ1/IrHQjmPITDEJdkxgFaPv7QkOL49k7MbmbtcMWit7j ziUuIw/Rq95yF8hjpc7DirP8lrB/AP9iPYKQkePxfGawn12jQr3gWEIbxCYZEfH52HIn ivtzqFiNBO4d/qxGtGCrRZBhgU6k+lNqPc/SElKFM9K8iiTGd6d4edx1e2x8f7itVwDl 3j/MC4rYxBD/wUGjtqVjwe/yGhpMFnlIM+lmbBwTDlQmEul39ZXTaGnm5thuriQ9H+0a LlqleLvdN7CJOMBYdAZ915Jyph3Bul8ErQmRxhlJaL/ixydmMQs2qbEMi6h/iioNmh9b wCfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=3m5F5SZmhCySHaq4Kl+nNPgZPVM9ttm1TTYlw+maT9E=; b=uBPDTZmqxsZ6ehBniBZMbIIRiUseOck/yCjsVn0pTNvN4LfTLyqmHZf8AhqvdAymLR ZpIwRPOec7S7MsibEe/ROb/+bNbVajDU2Lmqb9cKNEaFisgswTX71N8q5w/w3MyRAvbS scV0HVdqIp7Nd0Su2C5MODmSqJFD/70gTBnpsZrM5f0vMyTbTLReYHVov/c5Ed8+zzJl DyADqM5tUmVkm2kk2TQ1hkRIdP56Ehk/rvQt7hrtzafShqiByxw4vi2nCPerFVrZrw+i d8ryw4hLto4Tza0tQfYrcnP5dinm09RntOnHjhpvSfPwpRebXjjPEGic0ykrBOVG5t0H Tf2g== X-Gm-Message-State: ANoB5plBri3eUyoFfQAQIEjFvC+8kf5tpw+QN45QsD2QCxmW1SJsUkVk +d1D2IysR0glSZ2XbD3HZewc/g== X-Google-Smtp-Source: AA0mqf5tmeQONwE26vLCpkyddTpVvkN7A/tfrv/HQaUC8nVZjAqUywmWqMwYQ8ENrzKcMCsDq8fIGA== X-Received: by 2002:a17:90a:fa46:b0:200:1df3:a7a9 with SMTP id dt6-20020a17090afa4600b002001df3a7a9mr74111196pjb.202.1669892424814; Thu, 01 Dec 2022 03:00:24 -0800 (PST) Received: from ?IPV6:2400:4050:c360:8200:7b99:f7c3:d084:f1e2? ([2400:4050:c360:8200:7b99:f7c3:d084:f1e2]) by smtp.gmail.com with ESMTPSA id x8-20020a170902ec8800b001895d87225csm3324805plg.182.2022.12.01.03.00.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 Dec 2022 03:00:24 -0800 (PST) Message-ID: Date: Thu, 1 Dec 2022 20:00:22 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: [PATCH] accel/kvm/kvm-all: Handle register access errors Content-Language: en-US To: Peter Maydell Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org, Paolo Bonzini References: <20221201102728.69751-1-akihiko.odaki@daynix.com> From: Akihiko Odaki In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: none client-ip=2607:f8b0:4864:20::1029; envelope-from=akihiko.odaki@daynix.com; helo=mail-pj1-x1029.google.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, NICE_REPLY_A=-0.257, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 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 On 2022/12/01 19:40, Peter Maydell wrote: > On Thu, 1 Dec 2022 at 10:27, Akihiko Odaki wrote: >> >> A register access error typically means something seriously wrong >> happened so that anything bad can happen after that and recovery is >> impossible. >> Even failing one register access is catastorophic as >> architecture-specific code are not written so that it torelates such >> failures. >> >> Make sure the VM stop and nothing worse happens if such an error occurs. >> >> Signed-off-by: Akihiko Odaki > > In a similar vein there was also > https://lore.kernel.org/all/20220617144857.34189-1-peterx@redhat.com/ > back in June, which on the one hand was less comprehensive but on > the other does the plumbing to pass the error upwards rather than > reporting it immediately at point of failure. > > I'm in principle in favour but suspect we'll run into some corner > cases where we were happily ignoring not-very-important failures > (eg if you're running Linux as the host OS on a Mac M1 and your > host kernel doesn't have this fix: > https://lore.kernel.org/all/YnHz6Cw5ONR2e+KA@google.com/T/ > then QEMU will go from "works by sheer luck" to "consistently > hits this error check"). So we should aim to land this extra > error checking early in the release cycle so we have plenty of > time to deal with any bug reports we get about it. > > thanks > -- PMM Actually I found this problem when I tried to run QEMU with KVM on M2 MacBook Air and encountered a failure described and fixed at: https://lore.kernel.org/all/20221201104914.28944-2-akihiko.odaki@daynix.com/ Although the affected register was not really important, QEMU couldn't run the guest well enough because kvm_arch_put_registers for ARM64 is written in a way that it fails early. I guess the situation is not so different for other architectures as well. I still agree that this should be postponed until a new release cycle starts as register saving/restoring is too important to fail. Regards, Akihiko Odaki