From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B6AB6224B05 for ; Mon, 15 Sep 2025 17:01:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757955719; cv=none; b=VffALc67qUD2vYHpFOR1xb+W+V1BI5JIMjQbCo3PF1dTQhrRN3BTrlIVYgAM/7Pp80iPs6xoS4LgTLmWm/PfjKbSG+Ip+bypuHoE0Wutk8uwLyMGn9GWrqQyd3+VjchuQ9aKjbU11vUnA33SVrNoFck4Atp8hLmDGVUFQ4BIHB0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757955719; c=relaxed/simple; bh=n4vASe85eZy1KMZCjpCPLB0+R5aQYRJHMP2IQSmxlmc=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:To:From:Subject: References:In-Reply-To; b=hrAotxhc26EZ367YRpnsRGDbQLeXo2eQucT16N0UVDrPUiE7XsR2kNhxOZrTal6xS6MyI79FgJC6pycTABstcAugk5y0yskDROVrB+98VszKJU00MnO2jtUk31s3kIoWGxnrhsORYZzXC7uFUiCTiuxnVbe0lIBtjEpmXthg9uE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com; spf=pass smtp.mailfrom=ventanamicro.com; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b=eZn8VCfB; arc=none smtp.client-ip=209.85.221.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ventanamicro.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="eZn8VCfB" Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-3eb01f4f76bso44627f8f.1 for ; Mon, 15 Sep 2025 10:01:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1757955716; x=1758560516; darn=vger.kernel.org; h=in-reply-to:references:subject:from:to:cc:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=DWHHL1s0psJfb//epbwV/zjtkXGJcyLhcOl2Is0sDa4=; b=eZn8VCfBDEKTZwke7bXWAQf55cyK6DZXnVN9WPzRSrzp98LIj0F2Z1Lnzgz0r4ghfE UWKtLfQH7Vo+20SQ7kS9+8Ei/dn1VxzGn18OvllnDBw5CUi0gHACWGr/EVqwbPLQRiJX 3WYbSMSdHoT3GKw+ktHo7rHpraun6EMY/ejyKDhjSwXEuISFRrla0HbDjwXZei9wkdgw QMWfndUxGVN1l78ZyJGFWuaIL9ZT4pXxDn+Z19J7Yvl3ZsyougONebbLb+aDbhz6vmCe If4QBIciBdYsJ3JAFek2h0j+NpSYijHQBLDlPE5s0Nb/icoQ8svkPTPy4V+FihyCcvPq cB/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757955716; x=1758560516; h=in-reply-to:references:subject:from:to:cc:message-id:date :content-transfer-encoding:mime-version:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=DWHHL1s0psJfb//epbwV/zjtkXGJcyLhcOl2Is0sDa4=; b=JP7vtBWb1ep73Z6w3Te5LLfSumlTyohbMmZ+1SLBRB5kFMNF12q7rweO7cnA4tIsoX uJ8z+PovA6v2/sZMz1fteJFLaLh6jA3n0vMOFma/vqB5++Dp+SWsGzDL9AuSZmcYYiY4 VACwo9tKQ33e9TEzNSCgDoNkgHPtMkowF9kSuV0WMS0ENt7dP9I3Rw1rwfXGpPcmKQMr 2Nkg76iFZHUFJAnde7WKz4LvMh5uJbcfQxnGgoquw7VmR1PJuubTSGPj6bkcYWRF70YM l5hps7cglkRkcU+11DM3Dva+vrGDFkDSCzl6ECU7mtOsQ8V1Id3SdJFDAlJ061TpOLD5 qqDg== X-Forwarded-Encrypted: i=1; AJvYcCW6/IY14dux8qmKeeDIefZPGNciWvNiTm2RpkciGa1bmJDuhWOM/pP1o0qLwlKKM+k+mLEWUiqe8aKx3G4=@vger.kernel.org X-Gm-Message-State: AOJu0Yz8sx9hMbeqsC5P7CkSAi6k/Qg45faMh5ahqw82kLKWb9TWNfMV tGfOd8RNj6UehrW5Rg55bpL2OeaZ5lnoDfs8TpX/HVnr4JKLYBrCo2SK9PLEN/rQOg4= X-Gm-Gg: ASbGncuL/zp7jmdKvf/Fl1PpIdkVJ3oFoy6HRVVLLVPYH0k9J7XWdePmVGLK4HyPYdi nH9y/laI3IEIjJrMhlR7YLbvaZVOuvjUU3sw2NvOf6X1yEIKRYyR02fEoNTWMTolTio23E8PiYe XGffp/bDjEmKSRADhIeRfoVNoSwhaqdSC1afcH+HwdIbprXfa8CjRAOwAXmXda9T/4XeYOcf/PY 4WZ9Zn5ZLvTbaYMWNShnD8mEL8EjJ8F2y1K3k3peBUFKTFxg9Jv+OsVG8P+rG78tnFn6G9Hw6nB w8EaEnjnsZV+OoZj6a7zAy6V4O1v9N6QhdjBsHUpm450zqkovLszlnL8Cwjipw52FsFJG6wVrCv z1fTkTAxCxNwdBB5JPeSjOw== X-Google-Smtp-Source: AGHT+IFU1lq2Hn1rhnQ1PXztdy1u0/BZUM8rfqOS080uGF0cxwIiBohWrEivOXB1opFs7TzdP9qSMg== X-Received: by 2002:a5d:64e3:0:b0:3e6:4b2:b9b2 with SMTP id ffacd0b85a97d-3e7659e936fmr5550562f8f.6.1757955715906; Mon, 15 Sep 2025 10:01:55 -0700 (PDT) Received: from localhost ([2a02:8308:a00c:e200::bfbb]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-3e9c2954b10sm7301300f8f.50.2025.09.15.10.01.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Sep 2025 10:01:55 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Mon, 15 Sep 2025 19:01:03 +0200 Message-Id: Cc: , , , , "Tianshun Sun" To: "Jinyu Tang" , "Anup Patel" , "Atish Patra" , "Andrew Jones" , "Conor Dooley" , "Yong-Xuan Wang" , "Paul Walmsley" , "Nutty Liu" From: =?utf-8?q?Radim_Kr=C4=8Dm=C3=A1=C5=99?= Subject: Re: [RFC PATCH] kvm/riscv: Add ctxsstatus and ctxhstatus for migration References: <20250915152731.1371067-1-tjytimi@163.com> In-Reply-To: 2025-09-15T18:52:56+02:00, Radim Kr=C4=8Dm=C3=A1=C5=99 : > 2025-09-15T23:27:31+08:00, Jinyu Tang : >> + if (reg_num =3D=3D KVM_REG_RISCV_CSR_REG(ctxhstatus)) >> + csr->ctxhstatus =3D vcpu->arch.guest_context.hstatus; > > Neither should userspace be able to directly set hstatus. > KVM should derive it from other userspace configuration. > > What isn't correctly reflected in hstatus? Ah, we don't set hstatus.SPVP when setting KVM_REG_RISCV_CORE_REG(mode).