Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2337723ybl; Thu, 29 Aug 2019 07:00:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqwLgIU5vqP5UJlSg4Sds+BgAYGQ4y8xvwWMB9CdfeTi8Hf042VEV3ZGXPODucnvTsx55dlQ X-Received: by 2002:a17:902:aa09:: with SMTP id be9mr9764279plb.52.1567087204400; Thu, 29 Aug 2019 07:00:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1567087204; cv=pass; d=google.com; s=arc-20160816; b=q60SgRF/77pYHm0dpD53fgk3yKX8jQQruhE9URpfbFgQmdt4mHkoN8wDUffMI/IyB1 SEhoBSJo1LOa1y+4beQ0eYdGxRTEjUPUOraj5mZNhsT5DE2gQ26zcPVYYz4Z51FRhzIF xLKScNvDaTKTlo6LJgYiaFOA98NHqzw5CL7pkNYDQC1pjH4Ig9Xq+q8Aq04g4+kzZzoU 7/SaeAfK3aO6dGwJMl6mDziV/psKXXqvgAcn7Nol5sGomMKIlig0GnEk8z42axbfqYcm 6zAPVbenV34KCkiNsWYV0zNK4Mxy4R0qk3b7tz3ldlPNv6dVvyD+kDrhF5+4PaWy5RrG qdEQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :wdcipoutbound:content-language:accept-language:in-reply-to :references:message-id:date:thread-index:thread-topic:subject:cc:to :from:dkim-signature:ironport-sdr:dkim-signature; bh=eMybPEvi6fujs2mjK9MOUGiLCU9xPUxG8Q5CGafv6tQ=; b=rVZj3e+fUnlHFwmUdxSm+zZe2dFkl7hiVZXUHI6FR8ETGfhKdKCB546rlhgCFTNmgi 0RQ0CeeP0WyYe1Z81EI2qh0eYDlu6m7lTuPk22RfxUPZMRdjLmLFxAzAYvVOh4CZlsAW MK64hXU6CcitIxMX2FRCnzEiyXzV8Z8dBod8ljGab6hEwLTLdRY8ojPBTc+9T69apoSi v+Dx9wGdnGgmszfDAWst4CHZHrwgdy59jV1hLVylf/RzCI1KruJv9/C9Ef/UXv0IFGPK hKsAhXVLn1ZulRUkQptIBarJGylibydXADCpiky2SOl1czLIPr5N2cp7kBPJ0RJ3hYsc 1rfQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=ApMt7Q+h; dkim=pass header.i=@sharedspace.onmicrosoft.com header.s=selector2-sharedspace-onmicrosoft-com header.b=p150fc3p; arc=pass (i=1 spf=pass spfdomain=wdc.com dkim=pass dkdomain=wdc.com dmarc=pass fromdomain=wdc.com); 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=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b25si2114263pgl.270.2019.08.29.06.59.48; Thu, 29 Aug 2019 07:00:04 -0700 (PDT) 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=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=ApMt7Q+h; dkim=pass header.i=@sharedspace.onmicrosoft.com header.s=selector2-sharedspace-onmicrosoft-com header.b=p150fc3p; arc=pass (i=1 spf=pass spfdomain=wdc.com dkim=pass dkdomain=wdc.com dmarc=pass fromdomain=wdc.com); 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=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727834AbfH2N5K (ORCPT + 99 others); Thu, 29 Aug 2019 09:57:10 -0400 Received: from esa5.hgst.iphmx.com ([216.71.153.144]:1221 "EHLO esa5.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727387AbfH2N5J (ORCPT ); Thu, 29 Aug 2019 09:57:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1567087029; x=1598623029; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=31SfPGVe5TWj6nux8QaEMl1XlpXcGOSARvTEx6QtzOQ=; b=ApMt7Q+huHorSt11lsJiWTUBBV39r6GrsYSJFGF083TuEkvwiUjdEoak mrtffqn4VfV8Bp9AaBYxTifKd7CqL5TShDmVXV9808A9iNBsYHEIZSPZh 2ZVnXALkV8489kurt49bueNR+ogynZ206qJEUcH0PpH5en/OGFlgd8QFE 7NRuLdjtVRilVTi1TkRB2R1OceLReE1n78UIWLWO0GG/SQk2ZjAdtJe8E 6MUMRl+TTK5x3MKXMrWqKzXzK/LH7VAZHE/bR7KWEXess1jcHl27Ksey9 Gb3zCw+3PzYvPqly8v/B/w+CN3Vm96kLmRNd4e5rm+E9rqUa+Z8ane0Ai A==; IronPort-SDR: L8bMzRKP739X4apUBau+v0oxGfNdfhEW7mUbKcc6lqTePFCjBbyu5EGiEtmgQYoNUAV9YWrNua rO48IBU0coCacKzYOTn4apVB73KLcBMQG73JHZpxpKz2MJdkmtSMv5HIil7IiT+wt1gSgEnSlj rMvbI3V46ynElNNsZ/vefW8VXqFPrzBfgIS83gQHCHIzAURuotfz5Set1h8rwcHH8j/cn3XXie XCzL1+zekJo4Gy1mkFYexLar6/KxtOO3gIeYW2hIHs4oI8sjudu5DjHBSMQDuqbV1kDlS4L9xS Pgc= X-IronPort-AV: E=Sophos;i="5.64,443,1559491200"; d="scan'208";a="117866019" Received: from mail-co1nam05lp2055.outbound.protection.outlook.com (HELO NAM05-CO1-obe.outbound.protection.outlook.com) ([104.47.48.55]) by ob1.hgst.iphmx.com with ESMTP; 29 Aug 2019 21:57:07 +0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S+O8wBGy0lTfwYtLrKfZU/6Nq9yMiXKKQuirgvEESTfIL252R2ck2trSlAHgEUEcM5Nr/A48vpyenSDB1tyAwRRY30Tk10I1uNuaRMq0FT0jm5aGDskaaBQFYnDCwLT7/PGai674Xsv91pP41ZSXDyMZiAPKIpW1/qDfZPkoP+xjnxi9uSfklSe3Bjdr7RNr3fwQOTS1Xc6Dq0H/2uh4/Ia4FkUb0lEMVq2Q/i8saM49GQ/Y/drpk5R8g87kN2UjDB9YzB7i1XydGQmK8z3QlQmMUZinjUZKIOIUJaH0VEUq64JRnzF8G03t1tBCPYLR+ZSyV67RFyFgtUFDIqir0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eMybPEvi6fujs2mjK9MOUGiLCU9xPUxG8Q5CGafv6tQ=; b=PAxmc4yPa8l1HyPNRlNIludEs7uvFV42pZOuIDgjda+AsNUW6c8Yxl/G6V3womWH2+gkbLoYfZQm6rIRuDUAm+04LzxC8XhUMq8eeqIPtKwQtsa4kNGCjyj5sLMzwYqwGOYzRMAC/MBsEdYcTQqdZ8qjTjHINyxKeTEh0E3jGT8MKsbnkbm+AdynysO9WWvzQ75GFqUu+bORG7C/G/urpgo0nTlDXgm7q23k52vsux4YVsIdcHPDfVwvz3zslv04tI5JUtqyBopgftAanRFZ9NIJvgoQ5mE9E/yPt83kJCeA7CT0OhkAFB1edHy634GWjWTOxxWYk5cvhoP4DEVzhg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wdc.com; dmarc=pass action=none header.from=wdc.com; dkim=pass header.d=wdc.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector2-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eMybPEvi6fujs2mjK9MOUGiLCU9xPUxG8Q5CGafv6tQ=; b=p150fc3pFOQBIyCMgIxnEuIaoADD2KBCtfFaEu7AxFnGvThEKujUeWBWj8UeAilT3TbilRuKx7rvvQ6NoSn9YpiV1mciIQ4PTqRpbqhxxEZ1F65IqJiFtg4neW+X6K7nrEdUZQkPasenhbf8kyRP0IKX88/brcPoKa90iO0Kmt8= Received: from MN2PR04MB6061.namprd04.prod.outlook.com (20.178.246.15) by MN2PR04MB6255.namprd04.prod.outlook.com (20.178.245.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2199.21; Thu, 29 Aug 2019 13:57:06 +0000 Received: from MN2PR04MB6061.namprd04.prod.outlook.com ([fe80::e1a5:8de2:c3b1:3fb0]) by MN2PR04MB6061.namprd04.prod.outlook.com ([fe80::e1a5:8de2:c3b1:3fb0%7]) with mapi id 15.20.2220.013; Thu, 29 Aug 2019 13:57:06 +0000 From: Anup Patel To: Palmer Dabbelt , Paul Walmsley , Paolo Bonzini , Radim K CC: Daniel Lezcano , Thomas Gleixner , Atish Patra , Alistair Francis , Damien Le Moal , Christoph Hellwig , Anup Patel , "kvm@vger.kernel.org" , "linux-riscv@lists.infradead.org" , "linux-kernel@vger.kernel.org" , Anup Patel Subject: [PATCH v6 17/21] RISC-V: KVM: Implement ONE REG interface for FP registers Thread-Topic: [PATCH v6 17/21] RISC-V: KVM: Implement ONE REG interface for FP registers Thread-Index: AQHVXnGkmhFBH/2n4EC4An1qHFXLYw== Date: Thu, 29 Aug 2019 13:57:06 +0000 Message-ID: <20190829135427.47808-18-anup.patel@wdc.com> References: <20190829135427.47808-1-anup.patel@wdc.com> In-Reply-To: <20190829135427.47808-1-anup.patel@wdc.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: MAXPR0101CA0072.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:e::34) To MN2PR04MB6061.namprd04.prod.outlook.com (2603:10b6:208:d8::15) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Anup.Patel@wdc.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.17.1 x-originating-ip: [49.207.51.114] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e9463364-7488-45b9-3ef7-08d72c88c6fe x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600166)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020);SRVR:MN2PR04MB6255; x-ms-traffictypediagnostic: MN2PR04MB6255: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: wdcipoutbound: EOP-TRUE x-ms-oob-tlc-oobclassifiers: OLM:854; x-forefront-prvs: 0144B30E41 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(4636009)(39860400002)(366004)(396003)(346002)(376002)(136003)(199004)(189003)(446003)(55236004)(11346002)(76176011)(386003)(2616005)(53936002)(36756003)(25786009)(5660300002)(4326008)(6436002)(316002)(6486002)(99286004)(6506007)(71190400001)(256004)(6512007)(486006)(52116002)(2906002)(476003)(1076003)(102836004)(478600001)(81166006)(81156014)(110136005)(8676002)(54906003)(26005)(66446008)(64756008)(66556008)(66476007)(86362001)(7416002)(6116002)(50226002)(7736002)(14454004)(3846002)(66066001)(8936002)(44832011)(71200400001)(66946007)(186003)(305945005);DIR:OUT;SFP:1102;SCL:1;SRVR:MN2PR04MB6255;H:MN2PR04MB6061.namprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: /qwqdx9eZUARgd66j4djOjBMsYxz29czHiAuYLLyyhaBQSHX7YeYZA17vOrO8MO75i5BC4AqmctsarFLFFTjCgmTJgpD7lvo3dfEiIPEhDqjCIMf81i2RxAVUWdgdmMCEARiQmRY/y1rXabHQSiEEcGq/vCD7C5cYltbDX/2TRVs3f0Rv430X2pYaoneFTZBMOmMH9V1Iv1jrDw7zt2jwKwHxMbjmRxggz1Oiw7Xza++PMMKxyiwjhuDoZQloy3XQUldbZjRBfeCpI/GwAilPP8xJqZX2qBbciuxABH8HU//nkrDzUYr3sBW4FqMabtd8woGlO33jCbtyCIfaE6cqL/9AaEaKQwjvO8tCqPbE8mB3H+myzT3DbWEwdD840gG06onfLk0ufOJezENob9h57cHcb1x3Me11fPoaqVw0s0= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: e9463364-7488-45b9-3ef7-08d72c88c6fe X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Aug 2019 13:57:06.3738 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: qBdivcpY4mBARlaBxBQhb93YLgKlYc12a+BGShQ0Xo3lZhFOuynmq6IDQQ1hZzfMmx1uobZL/mhFMcvfD9GmLA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR04MB6255 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Atish Patra Add a KVM_GET_ONE_REG/KVM_SET_ONE_REG ioctl interface for floating point registers such as F0-F31 and FCSR. This support is added for both 'F' and 'D' extensions. Signed-off-by: Atish Patra Signed-off-by: Anup Patel Acked-by: Paolo Bonzini Reviewed-by: Paolo Bonzini Reviewed-by: Alexander Graf --- arch/riscv/include/uapi/asm/kvm.h | 10 +++ arch/riscv/kvm/vcpu.c | 104 ++++++++++++++++++++++++++++++ 2 files changed, 114 insertions(+) diff --git a/arch/riscv/include/uapi/asm/kvm.h b/arch/riscv/include/uapi/as= m/kvm.h index 08c4515ad71b..60184eaf720b 100644 --- a/arch/riscv/include/uapi/asm/kvm.h +++ b/arch/riscv/include/uapi/asm/kvm.h @@ -89,6 +89,16 @@ struct kvm_riscv_config { #define KVM_REG_RISCV_CSR_REG(name) \ (offsetof(struct kvm_sregs, name) / sizeof(unsigned long)) =20 +/* F extension registers are mapped as type4 */ +#define KVM_REG_RISCV_FP_F (0x04 << KVM_REG_RISCV_TYPE_SHIFT) +#define KVM_REG_RISCV_FP_F_REG(name) \ + (offsetof(struct __riscv_f_ext_state, name) / sizeof(u32)) + +/* D extension registers are mapped as type 5 */ +#define KVM_REG_RISCV_FP_D (0x05 << KVM_REG_RISCV_TYPE_SHIFT) +#define KVM_REG_RISCV_FP_D_REG(name) \ + (offsetof(struct __riscv_d_ext_state, name) / sizeof(u64)) + #endif =20 #endif /* __LINUX_KVM_RISCV_H */ diff --git a/arch/riscv/kvm/vcpu.c b/arch/riscv/kvm/vcpu.c index bb3f2a857b22..e52a608f8020 100644 --- a/arch/riscv/kvm/vcpu.c +++ b/arch/riscv/kvm/vcpu.c @@ -427,6 +427,98 @@ static int kvm_riscv_vcpu_set_reg_csr(struct kvm_vcpu = *vcpu, return 0; } =20 +static int kvm_riscv_vcpu_get_reg_fp(struct kvm_vcpu *vcpu, + const struct kvm_one_reg *reg, + unsigned long rtype) +{ + struct kvm_cpu_context *cntx =3D &vcpu->arch.guest_context; + unsigned long isa =3D vcpu->arch.isa; + unsigned long __user *uaddr =3D + (unsigned long __user *)(unsigned long)reg->addr; + unsigned long reg_num =3D reg->id & ~(KVM_REG_ARCH_MASK | + KVM_REG_SIZE_MASK | + rtype); + void *reg_val; + + if ((rtype =3D=3D KVM_REG_RISCV_FP_F) && + riscv_isa_extension_available(&isa, f)) { + if (KVM_REG_SIZE(reg->id) !=3D sizeof(u32)) + return -EINVAL; + if (reg_num =3D=3D KVM_REG_RISCV_FP_F_REG(fcsr)) + reg_val =3D &cntx->fp.f.fcsr; + else if ((KVM_REG_RISCV_FP_F_REG(f[0]) <=3D reg_num) && + reg_num <=3D KVM_REG_RISCV_FP_F_REG(f[31])) + reg_val =3D &cntx->fp.f.f[reg_num]; + else + return -EINVAL; + } else if ((rtype =3D=3D KVM_REG_RISCV_FP_D) && + riscv_isa_extension_available(&isa, d)) { + if (reg_num =3D=3D KVM_REG_RISCV_FP_D_REG(fcsr)) { + if (KVM_REG_SIZE(reg->id) !=3D sizeof(u32)) + return -EINVAL; + reg_val =3D &cntx->fp.d.fcsr; + } else if ((KVM_REG_RISCV_FP_D_REG(f[0]) <=3D reg_num) && + reg_num <=3D KVM_REG_RISCV_FP_D_REG(f[31])) { + if (KVM_REG_SIZE(reg->id) !=3D sizeof(u64)) + return -EINVAL; + reg_val =3D &cntx->fp.d.f[reg_num]; + } else + return -EINVAL; + } else + return -EINVAL; + + if (copy_to_user(uaddr, reg_val, KVM_REG_SIZE(reg->id))) + return -EFAULT; + + return 0; +} + +static int kvm_riscv_vcpu_set_reg_fp(struct kvm_vcpu *vcpu, + const struct kvm_one_reg *reg, + unsigned long rtype) +{ + struct kvm_cpu_context *cntx =3D &vcpu->arch.guest_context; + unsigned long isa =3D vcpu->arch.isa; + unsigned long __user *uaddr =3D + (unsigned long __user *)(unsigned long)reg->addr; + unsigned long reg_num =3D reg->id & ~(KVM_REG_ARCH_MASK | + KVM_REG_SIZE_MASK | + rtype); + void *reg_val; + + if ((rtype =3D=3D KVM_REG_RISCV_FP_F) && + riscv_isa_extension_available(&isa, f)) { + if (KVM_REG_SIZE(reg->id) !=3D sizeof(u32)) + return -EINVAL; + if (reg_num =3D=3D KVM_REG_RISCV_FP_F_REG(fcsr)) + reg_val =3D &cntx->fp.f.fcsr; + else if ((KVM_REG_RISCV_FP_F_REG(f[0]) <=3D reg_num) && + reg_num <=3D KVM_REG_RISCV_FP_F_REG(f[31])) + reg_val =3D &cntx->fp.f.f[reg_num]; + else + return -EINVAL; + } else if ((rtype =3D=3D KVM_REG_RISCV_FP_D) && + riscv_isa_extension_available(&isa, d)) { + if (reg_num =3D=3D KVM_REG_RISCV_FP_D_REG(fcsr)) { + if (KVM_REG_SIZE(reg->id) !=3D sizeof(u32)) + return -EINVAL; + reg_val =3D &cntx->fp.d.fcsr; + } else if ((KVM_REG_RISCV_FP_D_REG(f[0]) <=3D reg_num) && + reg_num <=3D KVM_REG_RISCV_FP_D_REG(f[31])) { + if (KVM_REG_SIZE(reg->id) !=3D sizeof(u64)) + return -EINVAL; + reg_val =3D &cntx->fp.d.f[reg_num]; + } else + return -EINVAL; + } else + return -EINVAL; + + if (copy_from_user(reg_val, uaddr, KVM_REG_SIZE(reg->id))) + return -EFAULT; + + return 0; +} + static int kvm_riscv_vcpu_set_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg) { @@ -436,6 +528,12 @@ static int kvm_riscv_vcpu_set_reg(struct kvm_vcpu *vcp= u, return kvm_riscv_vcpu_set_reg_core(vcpu, reg); else if ((reg->id & KVM_REG_RISCV_TYPE_MASK) =3D=3D KVM_REG_RISCV_CSR) return kvm_riscv_vcpu_set_reg_csr(vcpu, reg); + else if ((reg->id & KVM_REG_RISCV_TYPE_MASK) =3D=3D KVM_REG_RISCV_FP_F) + return kvm_riscv_vcpu_set_reg_fp(vcpu, reg, + KVM_REG_RISCV_FP_F); + else if ((reg->id & KVM_REG_RISCV_TYPE_MASK) =3D=3D KVM_REG_RISCV_FP_D) + return kvm_riscv_vcpu_set_reg_fp(vcpu, reg, + KVM_REG_RISCV_FP_D); =20 return -EINVAL; } @@ -449,6 +547,12 @@ static int kvm_riscv_vcpu_get_reg(struct kvm_vcpu *vcp= u, return kvm_riscv_vcpu_get_reg_core(vcpu, reg); else if ((reg->id & KVM_REG_RISCV_TYPE_MASK) =3D=3D KVM_REG_RISCV_CSR) return kvm_riscv_vcpu_get_reg_csr(vcpu, reg); + else if ((reg->id & KVM_REG_RISCV_TYPE_MASK) =3D=3D KVM_REG_RISCV_FP_F) + return kvm_riscv_vcpu_get_reg_fp(vcpu, reg, + KVM_REG_RISCV_FP_F); + else if ((reg->id & KVM_REG_RISCV_TYPE_MASK) =3D=3D KVM_REG_RISCV_FP_D) + return kvm_riscv_vcpu_get_reg_fp(vcpu, reg, + KVM_REG_RISCV_FP_D); =20 return -EINVAL; } --=20 2.17.1