From patchwork Mon Mar 23 11:32:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Beata Michalska X-Patchwork-Id: 184734 Delivered-To: patch@linaro.org Received: by 2002:a92:1f12:0:0:0:0:0 with SMTP id i18csp3974884ile; Mon, 23 Mar 2020 04:33:30 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvz4tb9t+ScZPYxTtwjStww/4sl/BgrkqRGfFCpEIpZdHHPQafAwgz9t7ydLVnc6WosjMaC X-Received: by 2002:ac8:7518:: with SMTP id u24mr20950319qtq.283.1584963210507; Mon, 23 Mar 2020 04:33:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584963210; cv=none; d=google.com; s=arc-20160816; b=LCDX6tIX06srA//Qh4nX2bb8NhgW2ONPgC9G5ugoUDbPbUDnrnDDvl/dbvxlIFyhDf 2JVmMSPKcrgki1C+Lsn+pwdA+IA5CeHWWuE9HWqgOmq/0yDDuRx9mpFp0Noa1jE7ldr2 nT1sJU8FPXPOlujerYzDz6QAjZVGEdSuIXh46nzKjLTvEFyrxOmUUNCMADoLrOkLI+Lz QG5xBDr7m/C23e7HPcpUvBLd3TP2oCLASz1gvtkUmJdahZQeRv1kxuLdj5PM1mJnIQ0i qUxUjkrlTst+/G/lfve2KkI3ClXykOWkM4xUdpzZtPu32xj0ckkAs7cXIX7M8yIusxcN N5Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:message-id:date:subject:to:from :dkim-signature; bh=OFr1tIi8cNqRn/vqOmjCgvVbUW9BNVMVGSEGEidMUQo=; b=Uuuvabmkx+omKUznkvF+M8mONRZnmhV0r9tHD8o/XOX6kcwenMlenCNSYSGrr0p1W3 +L2jPqIRVHCbPGt6jFLYP9UgWuz9E8FgM2cbXP8EqnEF5X50rFFl07Y9DVWPumPLf+pF YITzykNRXT1A700KEz+kARnSax0kJWpT03z0beBhIGHD6Q7HNMSGkklIap8AqOiSVljP om6gHPIGYYR6Ab/361JyUtAwB9gT9cJrQQtMMhuBfGrvgH3vgkPegRV3LIYVJYIDgV+h xz9q8J/6JZAv2zGBKD8KVRlKQzVqbcMgowrisPnwFFV4stvppkzj6vnHYMPQpcJpxXqS svYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=w8JoIfan; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id dt14si8290322qvb.181.2020.03.23.04.33.30 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Mar 2020 04:33:30 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=w8JoIfan; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:60552 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGLKj-0002Ma-Vp for patch@linaro.org; Mon, 23 Mar 2020 07:33:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42979) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGLJz-0001H9-6n for qemu-devel@nongnu.org; Mon, 23 Mar 2020 07:32:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jGLJx-0006sP-KN for qemu-devel@nongnu.org; Mon, 23 Mar 2020 07:32:42 -0400 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:34611) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jGLJx-0006rQ-5a for qemu-devel@nongnu.org; Mon, 23 Mar 2020 07:32:41 -0400 Received: by mail-wm1-x343.google.com with SMTP id 26so8770793wmk.1 for ; Mon, 23 Mar 2020 04:32:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=OFr1tIi8cNqRn/vqOmjCgvVbUW9BNVMVGSEGEidMUQo=; b=w8JoIfan95I4XznIjXQzVeNo8l6Xh0dvD7b1TIGqibhY+C7dgyZ/uXfIkOs0/tLca3 mu5gXprM3b/6ukW0OSYSqSj2gDCyiKxXm4nAMftPVr0s4SNfld/kLo8Tt2Q7XnFf1JWc VSLpLWnfJjB/LpDlmkuCEmW9fxNDKJw2TwyD9jhaROX0AHoKXWd98KK0p3YVV/VOIFVO Xwi0Qi9/+noDPudjzi3zC1ALa+dYBodZl3uAsU6PxxIVp/Nz6O4Tr/4Y92ydDyzY6uZP a4QUMBMN9CD8+8HMKbQ8QSgg5FMODQV8g6/I4ALDRRRB+xkMfJfqOvG4mc+EVC5gUtfi 0NYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=OFr1tIi8cNqRn/vqOmjCgvVbUW9BNVMVGSEGEidMUQo=; b=DbvepbadR5tx+iNXFwrNFqQ4E4jXBlXZnHy7f5HsLxYZkc+Il1QLXwAMKzLctVNLc2 V6YlCldYGaBwbRX6D4R1zHev11Fe1FybfTE2x1X9Im0sUlqc0EfJRCOWy4oWt7eqakFO gvak584SSlFaSIAaYE4alA61cXdvjnwWG9WbWNXhk+3GRWIy1txdma3CohRT1o4qTl9k udhO5HmsEySSyPSk9sYjedgZ/kMd1dk3MfVi/wtUL8LrnGerm1LVGdToOyX8KZ/lytXS 8FK7UiWVm/qQO1cNc02IXBIdtyWOvtKnE5TvCtXSPqwb983E++rn2FNNpe33OOYe7FrP +WRA== X-Gm-Message-State: ANhLgQ16T9kl6A5qEmnSCVzAm94gBi94fABUofD/bZnTU+tEpZCPvIUY 6d58k7cfncbzHFhgWrxKjsecsAJb3A9dXQ== X-Received: by 2002:a1c:9904:: with SMTP id b4mr26621677wme.34.1584963159658; Mon, 23 Mar 2020 04:32:39 -0700 (PDT) Received: from moi-limbo-9350.home (host86-177-220-180.range86-177.btcentralplus.com. [86.177.220.180]) by smtp.gmail.com with ESMTPSA id 98sm23288473wrk.52.2020.03.23.04.32.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Mar 2020 04:32:39 -0700 (PDT) From: Beata Michalska To: qemu-devel@nongnu.org Subject: [PATCH v4 0/2] target/arm: kvm: Support for KVM DABT with no valid ISS Date: Mon, 23 Mar 2020 11:32:25 +0000 Message-Id: <20200323113227.3169-1-beata.michalska@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::343 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, drjones@redhat.com, Christoffer.Dall@arm.com, qemu-arm@nongnu.org, pbonzini@redhat.com, kvmarm@lists.cs.columbia.edu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Some of the ARMv7 & ARMv8 load/store instructions might trigger a data abort exception with no valid ISS info to be decoded. The lack of decode info makes it at least tricky to emulate the instruction which is one of the (many) reasons why KVM will not even try to do so. So far, if a guest made an attempt to access memory outside the memory slot, KVM reported vague ENOSYS. As a result QEMU exited with no useful information being provided or even a clue on what has just happened. ARM KVM introduced support for notifying of an attempt to execute an instruction that resulted in dabt with no valid ISS decoding info. This still leaves QEMU to handle the case, but at least now it gives more control and a start point for more meaningful handling of such cases. This patchset relies on KVM to insert the external data abort into the guest. v4: - Removing one of the patches as it is being picked-up separately target/arm: kvm: Inject events at the last stage of sync - Moving handling KVM issue to a separate patch - Minor changes wrt the review comments v3: - Fix setting KVM cap per vm not per vcpu - Simplifying the handler to bare minimum with no default logging to address the potential risk of overflooding the host (adding support for rate limiting the logs turned out to be bit too invasive to justify the little add-on value from logs in this particular case) - Adding handling KVM bug (for small range of affected kernels): little bit of trade-off between what's reasonable and what's effective: aborting qemu when running on buggy host kernel v2: - Improving/re-phrasing messaging - Dropping messing around with forced sync (@see [PATCH v2 1/2]) and PC alignment Beata Michalska (2): target/arm: kvm: Handle DABT with no valid ISS target/arm: kvm: Handle potential issue with dabt injection target/arm/cpu.h | 3 ++ target/arm/kvm.c | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++ target/arm/kvm32.c | 25 ++++++++++++++++ target/arm/kvm64.c | 34 ++++++++++++++++++++++ target/arm/kvm_arm.h | 21 ++++++++++++++ 5 files changed, 165 insertions(+) -- 2.7.4