Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp920840pxf; Wed, 7 Apr 2021 15:06:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxt6qRgBL86D0jADO+cZreVwdxboZrtHpHrzYTOJgljejMD4ymK6A8Ur0T0BiH/ShkXa5cw X-Received: by 2002:a63:5466:: with SMTP id e38mr5284501pgm.172.1617833188321; Wed, 07 Apr 2021 15:06:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617833188; cv=none; d=google.com; s=arc-20160816; b=CD2p8ncEuUui2vUADrTHJ9sIRmOauIcTi+Ds96b6XmYBi5oyBXHaXKnccxnOmtTtG8 O/AFdLE//fdPzR/InuMhlIxXT+okGcd9lkcLvfra2nbkxJhY3KpHn6B7OpWSIFVp+Qbt QO43JW9RDmjVx7otl6y8Nyfe69tCGCOeV7O+mZRQPq05etPTY8yNlrWpGW0MpVVn4G4X p65xknaJIx6J04BCjPkBDO/4bnSpNg6mFBQUUnPOeXCb/Zbiy9S9MhiLtMIXuvwd2uXB XmtbYCrgQ+rX6wwAy27mEEimCd3zzREDLnYb/hZRHWUTBAFbiHLJWfKJV0PQj8n3Kf9W jiFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=JJX07rFbUFSCmW7iMNBNJnLHN/ul/VCQMW2GB/8R+9w=; b=Irim7T4MnC9yZQd6TZzI41TwibjYStKgsNimMiwS9syyCqyDo+fWs3TCXIq59OT5t8 4ZNPgZDXsTYKKfIqtjiYF6CWL4ntrKvXhWGUyYls5zDDjAsFJHr06D2Lst2XzjfUoA9R dj5zTPsDA/dT+Z+HMTBBX/stOajfIidI07eZ8yPzkCZ9rPZrzpMkuSOlcScUBD280HaC E9tNZ17+4iIXYQK8/x2AHVmxFYPUwVwopQ0f3iY6m0TFgbmzsJpxHZIcmrMiwq6zjXgz hgYVI5zcOdwoL6erJm8AOO8MIMonDP0L2mkexDv8pfUoYBsWnGpFvq+mojISsmZBuv6y ArIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.de header.s=amazon201209 header.b=XuM5o68l; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ay5si4016417plb.120.2021.04.07.15.06.16; Wed, 07 Apr 2021 15:06:28 -0700 (PDT) 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; dkim=pass header.i=@amazon.de header.s=amazon201209 header.b=XuM5o68l; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233255AbhDGVaE (ORCPT + 99 others); Wed, 7 Apr 2021 17:30:04 -0400 Received: from smtp-fw-4101.amazon.com ([72.21.198.25]:18869 "EHLO smtp-fw-4101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232890AbhDGVaD (ORCPT ); Wed, 7 Apr 2021 17:30:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.de; i=@amazon.de; q=dns/txt; s=amazon201209; t=1617830994; x=1649366994; h=from:to:cc:subject:date:message-id:mime-version; bh=JJX07rFbUFSCmW7iMNBNJnLHN/ul/VCQMW2GB/8R+9w=; b=XuM5o68lErS/35iEYt03BoBEByEaahVaBHuJa1mkJTjtL7oqtuH4qY75 iHu/dvbICz0zXNhP1ddHr25oFnbgtLcCgGPG+q8hNSdhD8CqAcyKizvdw EtNrMXQZ35Xqp6ZkE0YzgelKhIdzmKX9cdTxmNqAbgJBpcmVkHT4Wtduy Y=; X-IronPort-AV: E=Sophos;i="5.82,204,1613433600"; d="scan'208";a="100206498" Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO email-inbound-relay-2c-cc689b93.us-west-2.amazon.com) ([10.43.8.2]) by smtp-border-fw-out-4101.iad4.amazon.com with ESMTP; 07 Apr 2021 21:29:51 +0000 Received: from EX13D28EUC003.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan3.pdx.amazon.com [10.236.137.198]) by email-inbound-relay-2c-cc689b93.us-west-2.amazon.com (Postfix) with ESMTPS id 18D5C1200AB; Wed, 7 Apr 2021 21:29:50 +0000 (UTC) Received: from uc8bbc9586ea454.ant.amazon.com (10.43.162.68) by EX13D28EUC003.ant.amazon.com (10.43.164.43) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 7 Apr 2021 21:29:41 +0000 From: Siddharth Chandrasekaran To: , , , , , , , , , , , , , , CC: , , , , , Subject: [PATCH 0/4] Add support for XMM fast hypercalls Date: Wed, 7 Apr 2021 23:29:26 +0200 Message-ID: <20210407212926.3016-1-sidcha@amazon.de> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.43.162.68] X-ClientProxiedBy: EX13D01UWA003.ant.amazon.com (10.43.160.107) To EX13D28EUC003.ant.amazon.com (10.43.164.43) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hyper-V supports the use of XMM registers to perform fast hypercalls. This allows guests to take advantage of the improved performance of the fast hypercall interface even though a hypercall may require more than (the current maximum of) two general purpose registers. The XMM fast hypercall interface uses an additional six XMM registers (XMM0 to XMM5) to allow the caller to pass an input parameter block of up to 112 bytes. Hyper-V can also return data back to the guest in the remaining XMM registers that are not used by the current hypercall. Although the Hyper-v TLFS mentions that a guest cannot use this feature unless the hypervisor advertises support for it, some hypercalls which we plan on upstreaming in future uses them anyway. This patchset adds necessary infrastructure for handling input/output via XMM registers and patches kvm_hv_flush_tlb() to use xmm input arguments. ~ Sid. Siddharth Chandrasekaran (4): KVM: x86: Move FPU register accessors into fpu.h KVM: hyper-v: Collect hypercall params into struct KVM: x86: kvm_hv_flush_tlb use inputs from XMM registers KVM: hyper-v: Advertise support for fast XMM hypercalls arch/x86/include/asm/hyperv-tlfs.h | 4 +- arch/x86/kvm/emulate.c | 138 +++-------------- arch/x86/kvm/fpu.h | 140 +++++++++++++++++ arch/x86/kvm/hyperv.c | 241 +++++++++++++++++++---------- 4 files changed, 322 insertions(+), 201 deletions(-) create mode 100644 arch/x86/kvm/fpu.h -- 2.17.1 Amazon Development Center Germany GmbH Krausenstr. 38 10117 Berlin Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B Sitz: Berlin Ust-ID: DE 289 237 879