Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4695003rdb; Fri, 15 Sep 2023 09:28:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEepmC4QyLV0nH6Yxj2O2HDA6a7TnpkpIJBamp2/8IMaoKY0ed9G3JAQvhP/xg50NmySI4V X-Received: by 2002:a17:90a:7b8c:b0:274:99ed:a80c with SMTP id z12-20020a17090a7b8c00b0027499eda80cmr1253816pjc.3.1694795306843; Fri, 15 Sep 2023 09:28:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694795306; cv=none; d=google.com; s=arc-20160816; b=IZ+ChpuFr2l4asizfRy8cJMHeIudxdfWxQ/50mvIJxWH2ktQZfiyL19pEmqmw0/EqX HZ+dlRXe3mmmOdb+UowMyj9mp+eVrUREZKQOdFyDDqa36iUzMVqOUoqgGSR52foVdOfy 6rUSLnpjX4UDdIeNdEvxHeF9shUmL8QBmPngSn4m/pU/ccpY/w9TTJX9r3EIEnB0n0su YIlUvKO5hLX/aTP8p70svqCmMWSOjZ8zAjcq06LmsADVgSOAOg6BCV81MspwxREO4Bc4 sZc8v2x4u9rOxZ3bpeH6wf7RnIagxD22eGU4xae3zO8UVt9MoHbTVY7hFVATTN7Lh0YE XODQ== 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 :message-id:date:subject:cc:to:from; bh=uLxnpkNLCyV+SvUIpYfNDBOWfUtZjwRncjrK4WsRc9o=; fh=2vqTlNPINEt8u2O5VUjjdtxE8OgDGwETaTVTh/NI6As=; b=KQdx3pplaRhXfJuhTDE3QRQFnLsi6EC51Md12heR+gCQ2X2/Emqq+/aHHO9N9VAgdt j++5crbrtcrqUBRXxHrQI0B8FYKgs0vdo61jDEJX0lzAuWnsmTty6NkkEo2EUvYijLJ5 0a2HSL0eApnJwaM/W7ZHsx9ukU1TyxpG1xgVcTTrMMfxi635VPqbwJB54fQmJ6ZqLs6l wVbXuadLa1QWe9pp5tEskJhYRupWH+nUdJrxw13iyOE0WIPv3EvYyPi5v+maBM6VOSJ8 Heq1pbsOI+FEXr2MSij3sYFgalUEWyQELX9erE6iZmaAKaswFqU2nrSr3cUZxTBdpgpo BcTg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id v21-20020a17090a521500b0026f4d1e6940si2826199pjh.160.2023.09.15.09.28.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 09:28:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 825A5834D6AD; Fri, 15 Sep 2023 05:49:48 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235095AbjIOMtu (ORCPT + 99 others); Fri, 15 Sep 2023 08:49:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235074AbjIOMts (ORCPT ); Fri, 15 Sep 2023 08:49:48 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 501661713 for ; Fri, 15 Sep 2023 05:49:43 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id BC3501FB; Fri, 15 Sep 2023 05:50:19 -0700 (PDT) Received: from e126864.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B99A93F5A1; Fri, 15 Sep 2023 05:49:39 -0700 (PDT) From: Kristina Martsenko To: kvmarm@lists.linux.dev, linux-arm-kernel@lists.infradead.org Cc: Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Catalin Marinas , Will Deacon , Vladimir Murzin , Colton Lewis , linux-kernel@vger.kernel.org Subject: [PATCH 0/3] KVM: arm64: Support for Arm v8.8 memcpy instructions in KVM guests Date: Fri, 15 Sep 2023 13:48:37 +0100 Message-Id: <20230915124840.474888-1-kristina.martsenko@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 15 Sep 2023 05:49:48 -0700 (PDT) Hi, This series adds support for using the new Arm memory copy instructions in KVM guests. A previous series [1] added support for using the instructions in userspace applications. Similarly to that series, the main thing to note here is the handling for when a memcpy is stopped and continued on a different type of CPU. See patch #2 for details. As background, the Armv8.8 extension adds new instructions to perform memcpy(), memset() and memmove() operations in hardware (FEAT_MOPS). The aim is to avoid having many different performance-optimal memcpy implementations in software (tailored to CPU model and copy size) and the overhead of selecting between them. The new instructions are intended to be at least as fast as any alternative instruction sequence. The series has been tested on the Arm FVP. Thanks, Kristina [1] https://lore.kernel.org/all/20230509142235.3284028-1-kristina.martsenko@arm.com/ Kristina Martsenko (3): KVM: arm64: Configure HCRX_EL2 dynamically KVM: arm64: Add handler for MOPS exceptions KVM: arm64: Expose MOPS instructions to guests arch/arm64/include/asm/kvm_emulate.h | 10 ++++ arch/arm64/include/asm/kvm_host.h | 1 + arch/arm64/include/asm/traps.h | 54 ++++++++++++++++++- arch/arm64/kernel/traps.c | 48 +---------------- arch/arm64/kvm/arm.c | 1 + arch/arm64/kvm/hyp/include/hyp/switch.h | 19 ++++++- .../arm64/kvm/hyp/include/nvhe/fixed_config.h | 3 +- arch/arm64/kvm/hyp/nvhe/hyp-main.c | 1 + arch/arm64/kvm/hyp/nvhe/pkvm.c | 1 + arch/arm64/kvm/hyp/nvhe/switch.c | 2 + arch/arm64/kvm/hyp/vhe/switch.c | 1 + arch/arm64/kvm/sys_regs.c | 1 - 12 files changed, 90 insertions(+), 52 deletions(-) base-commit: 0bb80ecc33a8fb5a682236443c1e740d5c917d1d -- 2.25.1