Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4618853ybi; Tue, 30 Jul 2019 05:17:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqzBz7LZF7wTwUyJX2FZd3ABWvB+sWvuITj5xqF23lNpGo0w/NhC5iE/DdZgeTRNpGCloAuF X-Received: by 2002:a63:4612:: with SMTP id t18mr100089967pga.85.1564489046819; Tue, 30 Jul 2019 05:17:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564489046; cv=none; d=google.com; s=arc-20160816; b=lbndirVE+pvnDaQhk/EVMEUJ12PBBVgVW6P2q3uhrEi4B/Y9ZeWGgSZAxhvfJlfEYJ jx92fAaCsiJRrP7aTAuAylyq8YjHqRO1qzXpg2LNP9jgO1Jv+WxFC2aNx9RfkItWI1Tl 19CmGhTH/bFp/UtGQETFAyvmTblHbqc7pxDRzlM5Ku7LLRLBWw4JfjDm5BETWsJYPGFN nNYJjThq7SXXHVT1OsRF+98uRDM1ZPdXkoNCg3R9t6qyO4MUr/gGVY5d5du5UYfA6sjw WavU1g26vraSgvsb7haRNSZDGn6mGNetR+ovy5HHPUX5bWQDHrBNZj23md2aNz6j+4jC 0ytA== 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=URLGMXYUvPFwf9Ds8JQxcBHzIr6dahYGzK+VoJD8QhE=; b=WIOvfdEVS/4DlEakGs8qK0J4cn/HXfOEymqYMe1egk3JpgBIqb4/rnwya8GipWxFDC FXC8+UdOFHHqSY7T2+O44smhWW/xfgYa7qZu/Sxt0or1rMnWv+QWiscMigQJVY52eYM2 7lSB5wUh3ijZafWs9CIS9S2TbZtmmcbjw3xFZ+njFwleEgSeK70TWSbmfEF+T3AXJrKA 6jyZKKZqezqdFg+5KGkvXlXsriWIRjUJM8raFpxU6Rf6Dc2pVMH6oup7tBSbSb3NAMud 0GjU3qkN1ZGYgb0wpC86gyiMeL5bnY3OmSJn5o/sL0mg/ZylE2oJqeQ5r6hl4sZxAoLv 5Qqg== 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 y15si28228733pjp.90.2019.07.30.05.17.12; Tue, 30 Jul 2019 05:17:26 -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 S1729596AbfG3Lrx (ORCPT + 99 others); Tue, 30 Jul 2019 07:47:53 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:42368 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726241AbfG3Lrx (ORCPT ); Tue, 30 Jul 2019 07:47:53 -0400 Received: by mail-wr1-f66.google.com with SMTP id x1so15518747wrr.9 for ; Tue, 30 Jul 2019 04:47:52 -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=URLGMXYUvPFwf9Ds8JQxcBHzIr6dahYGzK+VoJD8QhE=; b=TuXew9/1KLfobqYcZtM97gUP/Spwjt2LkcIqe1QEtZ5e3npTkBjUzEroeiJjADd9jh 7sAFXnWTL2YI3Pk6aod2zpkjgajr4RumKSrSHvHVe8f1n9w93X9A9l96XAMXWsZ1JvgH wvOiIWOTZrbnacP42dZ9Cz48a4B5kPG+xEWPbgsXTw+u9+KpUDyDaS3HZtrhY3R/8CVs Ey2RWJachFuNWAYtneqM9iUq+hZ87udx8kRjG3J5KJICbNv1avMlHzbFoASH5Yd/apbh mrDsM8+va1yFwu5yPY/7vRzYUbklLn+uBPrFpCyBilFgtG1chgF9wNrzo3aqg5IXuv44 uv6Q== X-Gm-Message-State: APjAAAWg5KMKq0RuQ6PWqV9D7X057auI389iwtcXbyAFmkgpmfTZL5lL ubqje2iSu5K18Q7xwoF8XASZzaAaoC4= X-Received: by 2002:a5d:6a05:: with SMTP id m5mr54665638wru.305.1564487271786; Tue, 30 Jul 2019 04:47:51 -0700 (PDT) Received: from [192.168.10.150] ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id b8sm83186767wmh.46.2019.07.30.04.47.50 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Tue, 30 Jul 2019 04:47:50 -0700 (PDT) Subject: Re: [RFC PATCH 04/16] RISC-V: KVM: Implement VCPU create, init and destroy functions To: Anup Patel Cc: Anup Patel , Palmer Dabbelt , Paul Walmsley , Radim K , Daniel Lezcano , Thomas Gleixner , Atish Patra , Alistair Francis , Damien Le Moal , Christoph Hellwig , "kvm@vger.kernel.org" , "linux-riscv@lists.infradead.org" , "linux-kernel@vger.kernel.org" References: <20190729115544.17895-1-anup.patel@wdc.com> <20190729115544.17895-5-anup.patel@wdc.com> <2de10efc-56f8-ff47-ed69-7e471a099c80@redhat.com> From: Paolo Bonzini Openpgp: preference=signencrypt Message-ID: <00ec47ef-6c03-ec27-3894-7afd4757ee61@redhat.com> Date: Tue, 30 Jul 2019 13:47:49 +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 30/07/19 13:45, Anup Patel wrote: >> so: >> >> 1) indeed we need SP2V=SPV=1 when entering guest mode >> >> 2) sstatus.SPP contains the guest mode >> >> 3) SP2P doesn't really matter for KVM since it never goes to VS-mode >> from an interrupt handler, so if my reasoning is correct I'd leave it >> clear, but I guess it's up to you whether to set it or not. > Yes, SP2P does not matter but we set it to 1 here so that from Guest > perspective it seems we were in S-mode previously. But the guest never reads sstatus.SPP, it always reads, vsstatus.SPP doesn't it? In any case it doesn't matter. Paolo