Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp2668953ybh; Mon, 5 Aug 2019 04:57:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqxZFyd+TXkESMMGedGfUz2gWFJGA7OxjVhaX+T8aSQaXvHQWSKhBGzC+elY6JjJ0S3uBTss X-Received: by 2002:a63:5d54:: with SMTP id o20mr120286781pgm.413.1565006271120; Mon, 05 Aug 2019 04:57:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565006271; cv=none; d=google.com; s=arc-20160816; b=m+V1zUq2hHBt1bj238Diop795UHz0UI/UDoSBpyIRD65AInw1TfW09gAQI8r8wdAfR UDCB34SRSStveTO775WyUC7E2HQsXnr8DrwF6W0PiQbEWAC9DsOZAtswFGcZLLoPM06u TG05MdkfnvvN4MJCHVoqjHYqRpF9SrnaJyVasJBf5+sfekvhW1kp/GjqxaOoS3E8N4kP 414obkiKYF/7Oovyrb050HorIUahyoV+lJYVt2YSRmUEk0iUdsBQBqwybGMUddbBmjYe D7Wgo+IrB1FQklXLSKcxWWbM3Elvh1kxnDnpqWNW5mSAGaa31W47dEuTEJVIKxI1DZGE 74nQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:openpgp:from:references:cc:to:subject; bh=TY4SwjXmEN9gc5bLylSn4Hg0/dB7NKueAsPGd6xGBoQ=; b=Otu4xDmV34vsS2wEuJ7N8SDAITDuboFua0BZO48dcRXZKGC00h+gEn2uP2VkuZ51ic 9rQOrUKAJXX38AFkUhKISvheLM05hPX3sxDgVyCgU8Xbrb/ZpJA1s+b5940P0HNKvFtU oxsR+Er90GtpOlTlekZUW4b4KDN1MJw3+1Z5z9kXbehcN+OzY6hfTLeZ4hbi7LAP9fjR VA0wK1bhTe00KsfwE92BJI6vHXnJBdWweUQtrpwk+mgOy3HOwdk2uquxeqB6gQ/YF3tu 6XI1EtGAJObQ9eMuAyT1Eha1u/nimA1vX6wLybld0ED+RquDOgbHGxgS37CZm6H4ATr0 c2TA== ARC-Authentication-Results: i=1; mx.google.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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c8si45641632pfo.42.2019.08.05.04.57.35; Mon, 05 Aug 2019 04:57:51 -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; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728689AbfHEL4i (ORCPT + 99 others); Mon, 5 Aug 2019 07:56:38 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:37508 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728681AbfHEL4h (ORCPT ); Mon, 5 Aug 2019 07:56:37 -0400 Received: by mail-wr1-f66.google.com with SMTP id n9so59051308wrr.4 for ; Mon, 05 Aug 2019 04:56:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=TY4SwjXmEN9gc5bLylSn4Hg0/dB7NKueAsPGd6xGBoQ=; b=QB/BSZwdzuDkotLcFHtMEhOnmdWeZoV95B8M+SQMDirOTrzFWg6e8TJYUAGZh62Nld vG6BW3ehzIDr76Zq4QD7IXMA8PxsU81riK7ixXdm4ALLyZ8f5dnMPK9WQI7MnA3OOt+i M8SqsWH9i9rwzBCA8PYp9bL90gRdsPlX8/RQd1JYk23rNG87BriVKUK97MoUDLd3eDz4 N4qshsk2Pr0C9gFLSJjY0Y9eg69UGZFgWd0l/dlqYvE1etBo21sZKE1LybCS/YVhdv2e q0cJW0OVTQ7ra6t/2JUVUX9uzk4W9R3I5tEEijMMB0f2mOfqFaL/WUMs2CfZU5+BTTJk XdFA== X-Gm-Message-State: APjAAAUhpLnzXfsxi9z/xHSY66R2/7ZvHO3sCrvOmpUpXqDAg7pLnToi 9jHYkNSuDxpiRn8mmSYYPdyvrJTxK3k= X-Received: by 2002:a5d:4cc5:: with SMTP id c5mr107334032wrt.278.1565006195708; Mon, 05 Aug 2019 04:56:35 -0700 (PDT) Received: from [192.168.178.40] ([151.21.165.91]) by smtp.gmail.com with ESMTPSA id v15sm77198646wrt.25.2019.08.05.04.56.34 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Mon, 05 Aug 2019 04:56:35 -0700 (PDT) Subject: Re: [RFC PATCH v2 07/19] RISC-V: KVM: Implement KVM_GET_ONE_REG/KVM_SET_ONE_REG ioctls To: Christian Borntraeger , Anup Patel , Palmer Dabbelt , Paul Walmsley , 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" References: <20190802074620.115029-1-anup.patel@wdc.com> <20190802074620.115029-8-anup.patel@wdc.com> From: Paolo Bonzini Openpgp: preference=signencrypt Message-ID: <8563b869-1ab4-d0f1-afad-9cd864b6019a@redhat.com> Date: Mon, 5 Aug 2019 13:56:34 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/08/19 13:37, Christian Borntraeger wrote: > While have ONE_REG will certainly work, have you considered the sync_reg scheme > (registers as part of kvm_run structure) > This will speed up the exit to QEMU as you do not have to do multiple ioctls > (each imposing a systemcall overhead) for one exit. > > Ideally you should not exit too often into qemu, but for those cases sync_regs > is faster than ONE_REG. At least in theory, RISC-V should never have exits to QEMU that need accessing the registers. (The same is true for x86; Google implemented sync_regs because they moved the instruction emulator to userspace in their fork). Paolo