From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9290C433FE for ; Thu, 4 Nov 2021 16:10:26 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id 5AC2660D43 for ; Thu, 4 Nov 2021 16:10:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5AC2660D43 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id B0A514B089; Thu, 4 Nov 2021 12:10:25 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@google.com Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id amMkxG00m6XM; Thu, 4 Nov 2021 12:10:24 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 10EA649F5D; Thu, 4 Nov 2021 12:10:24 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 9823549F5D for ; Thu, 4 Nov 2021 12:10:22 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TfCO6HlRzVyi for ; Thu, 4 Nov 2021 12:10:21 -0400 (EDT) Received: from mail-io1-f45.google.com (mail-io1-f45.google.com [209.85.166.45]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 1B5A849E5F for ; Thu, 4 Nov 2021 12:10:21 -0400 (EDT) Received: by mail-io1-f45.google.com with SMTP id p193so7486395iod.8 for ; Thu, 04 Nov 2021 09:10:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=tUqoCGNnbxt+oywUiqReWRW9/LoLH193vc9R2cKGEpc=; b=oUHtN5yvmtuLU7Rt+p4AHRDksWqkQE+q3NqxcycZqtF9qmtzdBQ2tL5D+HqyyO/6T6 6RAH0Gm9enHnLZalZqd5vPhRiGo2BfuVG1/UtiQ5AlwtVyQxemDr2UAwLCeojaWJY//d HNaQIvQ9Z/HOjrGtUSDqmFuin9f0hb4Y5NwlAWG/Qb2plZ0RdYYhu1GhofX6SKx3Fcec jwV3+ZgpfWp9BUkGER+zSl8pSOY4QNbMW2htCUrZqDu7/lMD/Gm1y3hTLz0Q76u2LZ7Z UzOJSTuv5DMxl/thqh42/QR39gXTNNEE4XRxPV9P0rl7usFCGjCvM9eOZ5QGb5QuEpX8 Umtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=tUqoCGNnbxt+oywUiqReWRW9/LoLH193vc9R2cKGEpc=; b=VD/CBOctCTUkfwDN36mT709+1nBHTKC52na3vx1bxF/YBrERlJomVVTFqzPRwZlgYI XLdpPLNTrViWAMEAzAtEn4jHJwO6gmE05yj/Abegv3r7Ol1wEHlD5oLAQMdPFf8wGcy8 zKxPxvNYuOVfDdEUSd+x3DGdeXGMjlOZTuMwTeVpuI7zCvW4DdIVc/s6lOFZK8dvuE8e +m4EaNUJqMUZJ3uFlrrR7FOoxCWlOMpDe03Vm5FV444z6NjQcpYRIrzKQ0tgMYTsSIAh AQimBWHoJXBePqP/90GJhjsLKUkBNeh3mirBU4kAKtql4TzU0/KmVD5QW79De+gUoCzV OJdQ== X-Gm-Message-State: AOAM531iKwBTwE+mRPdcyJOF4elttYbi5/ETv7g3GDHQK6p8gvctEfvE 2A9W68wOj8mS/3iUi7v/GjoF6w== X-Google-Smtp-Source: ABdhPJysdsBusunjAyJwyQgc6/PueGiLqEhbeMUOLxDa87sm4If+utgQP/RXb6DCfoSyUOfBj47T8g== X-Received: by 2002:a05:6638:d84:: with SMTP id l4mr4682907jaj.30.1636042220331; Thu, 04 Nov 2021 09:10:20 -0700 (PDT) Received: from google.com (194.225.68.34.bc.googleusercontent.com. [34.68.225.194]) by smtp.gmail.com with ESMTPSA id w11sm2661526ior.40.2021.11.04.09.10.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Nov 2021 09:10:19 -0700 (PDT) Date: Thu, 4 Nov 2021 16:10:16 +0000 From: Oliver Upton To: Reiji Watanabe Subject: Re: [RFC PATCH v2 01/28] KVM: arm64: Add has_reset_once flag for vcpu Message-ID: References: <20211103062520.1445832-1-reijiw@google.com> <20211103062520.1445832-2-reijiw@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20211103062520.1445832-2-reijiw@google.com> Cc: kvm@vger.kernel.org, Marc Zyngier , Peter Shier , Will Deacon , Paolo Bonzini , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu On Tue, Nov 02, 2021 at 11:24:53PM -0700, Reiji Watanabe wrote: > Introduce 'has_reset_once' flag in kvm_vcpu_arch, which indicates > if the vCPU reset has been done once, for later use. > > Signed-off-by: Reiji Watanabe Reviewed-by: Oliver Upton > --- > arch/arm64/include/asm/kvm_host.h | 2 ++ > arch/arm64/kvm/reset.c | 4 ++++ > 2 files changed, 6 insertions(+) > > diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h > index f8be56d5342b..9b5e7a3b6011 100644 > --- a/arch/arm64/include/asm/kvm_host.h > +++ b/arch/arm64/include/asm/kvm_host.h > @@ -384,6 +384,7 @@ struct kvm_vcpu_arch { > u64 last_steal; > gpa_t base; > } steal; > + bool has_reset_once; > }; > > /* Pointer to the vcpu's SVE FFR for sve_{save,load}_state() */ > @@ -449,6 +450,7 @@ struct kvm_vcpu_arch { > > #define vcpu_has_sve(vcpu) (system_supports_sve() && \ > ((vcpu)->arch.flags & KVM_ARM64_GUEST_HAS_SVE)) > +#define vcpu_has_reset_once(vcpu) ((vcpu)->arch.has_reset_once) > > #ifdef CONFIG_ARM64_PTR_AUTH > #define vcpu_has_ptrauth(vcpu) \ > diff --git a/arch/arm64/kvm/reset.c b/arch/arm64/kvm/reset.c > index 5ce36b0a3343..4d34e5c1586c 100644 > --- a/arch/arm64/kvm/reset.c > +++ b/arch/arm64/kvm/reset.c > @@ -305,6 +305,10 @@ int kvm_reset_vcpu(struct kvm_vcpu *vcpu) > if (loaded) > kvm_arch_vcpu_load(vcpu, smp_processor_id()); > preempt_enable(); > + > + if (!ret && !vcpu->arch.has_reset_once) > + vcpu->arch.has_reset_once = true; > + > return ret; > } > > -- > 2.33.1.1089.g2158813163f-goog > _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F3181C433EF for ; Thu, 4 Nov 2021 16:11:52 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BECEC6113B for ; Thu, 4 Nov 2021 16:11:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BECEC6113B Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=NAqv0i87Qu+ILrZIb7D+JyQ1UnVzAJwD4MVxvq3RIXY=; b=n8bbwj0NsKp2H+ 7MJGmXzC4mPYLlLASoD/uv/oUMP15m1zGKWT1BH6ZtKYeYOX3YTVEveuK29k/z+RlJlsor78EpI3O ZGp/RpWeuPn/5B3zQ0IbPh/m/vJkYHn53+uhJHEyr3i6G4TeDdNxzSb5C8QwB94TzASfND+nAUw/H gqpSjpMhu9UcOad3wk5Pgeg/26Vnxdi2uPLNQOtp/IJTmqvwYt8AtT/2PR4Zse9FblOL1vaYDaqvq n7Jfn/eRvDL01mC/pnC/QsqQffR3E+Ig94uTKbtpfh6R0P+JCFw4+R3I3RMlaALPMGWx3hhnL/ORz oWqEaSg4APAwJohO8KjA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mifJp-009NAS-Sg; Thu, 04 Nov 2021 16:10:26 +0000 Received: from mail-io1-xd2f.google.com ([2607:f8b0:4864:20::d2f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mifJl-009N8k-O5 for linux-arm-kernel@lists.infradead.org; Thu, 04 Nov 2021 16:10:23 +0000 Received: by mail-io1-xd2f.google.com with SMTP id e144so7520080iof.3 for ; Thu, 04 Nov 2021 09:10:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=tUqoCGNnbxt+oywUiqReWRW9/LoLH193vc9R2cKGEpc=; b=oUHtN5yvmtuLU7Rt+p4AHRDksWqkQE+q3NqxcycZqtF9qmtzdBQ2tL5D+HqyyO/6T6 6RAH0Gm9enHnLZalZqd5vPhRiGo2BfuVG1/UtiQ5AlwtVyQxemDr2UAwLCeojaWJY//d HNaQIvQ9Z/HOjrGtUSDqmFuin9f0hb4Y5NwlAWG/Qb2plZ0RdYYhu1GhofX6SKx3Fcec jwV3+ZgpfWp9BUkGER+zSl8pSOY4QNbMW2htCUrZqDu7/lMD/Gm1y3hTLz0Q76u2LZ7Z UzOJSTuv5DMxl/thqh42/QR39gXTNNEE4XRxPV9P0rl7usFCGjCvM9eOZ5QGb5QuEpX8 Umtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=tUqoCGNnbxt+oywUiqReWRW9/LoLH193vc9R2cKGEpc=; b=h/6FkKTFIDntH7k1KJUCn/L8aK+DN6KPxx1/m2qhSRY4JI73CmRDrgT0K3UDaMU3Nw N1CzzQQsFpAjBTENTi+pVM387D9ZmAjadu75Q2NNsCkNlayfff87tJAeo4Cga/fTVt9B 7dfCY3I75EbR/lzyOOrrAc6E1qVfAHt12IdDmS+aDZX1XWj2H24Ti+52oz0t7+GIS5Fn yaFi4W9urhURP3vESSOO9hNOxoXtmyxXlEJshKxGm2EsgXUwLXdY7fxVdq/mMYDrL5Bq nG8yR0vkiNbV+7Y57cLqFtMuefoHZGP1Lu9mekkomo2lKTMD7rG0Ta/Yx1AywPjF+o+L ZBHw== X-Gm-Message-State: AOAM532KAb+4nUOhAt5GuGO2gt32Yx8RQO0LmY11Ax0tGfJkBovEDsXA 1MrgMEt1TDWrbLOH8qJHOHj1S6j7GBoj0A== X-Google-Smtp-Source: ABdhPJysdsBusunjAyJwyQgc6/PueGiLqEhbeMUOLxDa87sm4If+utgQP/RXb6DCfoSyUOfBj47T8g== X-Received: by 2002:a05:6638:d84:: with SMTP id l4mr4682907jaj.30.1636042220331; Thu, 04 Nov 2021 09:10:20 -0700 (PDT) Received: from google.com (194.225.68.34.bc.googleusercontent.com. [34.68.225.194]) by smtp.gmail.com with ESMTPSA id w11sm2661526ior.40.2021.11.04.09.10.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Nov 2021 09:10:19 -0700 (PDT) Date: Thu, 4 Nov 2021 16:10:16 +0000 From: Oliver Upton To: Reiji Watanabe Cc: Marc Zyngier , kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, James Morse , Alexandru Elisei , Suzuki K Poulose , Paolo Bonzini , Will Deacon , Andrew Jones , Peng Liang , Peter Shier , Ricardo Koller , Jing Zhang , Raghavendra Rao Anata Subject: Re: [RFC PATCH v2 01/28] KVM: arm64: Add has_reset_once flag for vcpu Message-ID: References: <20211103062520.1445832-1-reijiw@google.com> <20211103062520.1445832-2-reijiw@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20211103062520.1445832-2-reijiw@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211104_091021_819885_361A142A X-CRM114-Status: GOOD ( 18.03 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Nov 02, 2021 at 11:24:53PM -0700, Reiji Watanabe wrote: > Introduce 'has_reset_once' flag in kvm_vcpu_arch, which indicates > if the vCPU reset has been done once, for later use. > > Signed-off-by: Reiji Watanabe Reviewed-by: Oliver Upton > --- > arch/arm64/include/asm/kvm_host.h | 2 ++ > arch/arm64/kvm/reset.c | 4 ++++ > 2 files changed, 6 insertions(+) > > diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h > index f8be56d5342b..9b5e7a3b6011 100644 > --- a/arch/arm64/include/asm/kvm_host.h > +++ b/arch/arm64/include/asm/kvm_host.h > @@ -384,6 +384,7 @@ struct kvm_vcpu_arch { > u64 last_steal; > gpa_t base; > } steal; > + bool has_reset_once; > }; > > /* Pointer to the vcpu's SVE FFR for sve_{save,load}_state() */ > @@ -449,6 +450,7 @@ struct kvm_vcpu_arch { > > #define vcpu_has_sve(vcpu) (system_supports_sve() && \ > ((vcpu)->arch.flags & KVM_ARM64_GUEST_HAS_SVE)) > +#define vcpu_has_reset_once(vcpu) ((vcpu)->arch.has_reset_once) > > #ifdef CONFIG_ARM64_PTR_AUTH > #define vcpu_has_ptrauth(vcpu) \ > diff --git a/arch/arm64/kvm/reset.c b/arch/arm64/kvm/reset.c > index 5ce36b0a3343..4d34e5c1586c 100644 > --- a/arch/arm64/kvm/reset.c > +++ b/arch/arm64/kvm/reset.c > @@ -305,6 +305,10 @@ int kvm_reset_vcpu(struct kvm_vcpu *vcpu) > if (loaded) > kvm_arch_vcpu_load(vcpu, smp_processor_id()); > preempt_enable(); > + > + if (!ret && !vcpu->arch.has_reset_once) > + vcpu->arch.has_reset_once = true; > + > return ret; > } > > -- > 2.33.1.1089.g2158813163f-goog > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 713BFC433EF for ; Thu, 4 Nov 2021 16:10:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 541DA6113B for ; Thu, 4 Nov 2021 16:10:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231684AbhKDQNC (ORCPT ); Thu, 4 Nov 2021 12:13:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231695AbhKDQM7 (ORCPT ); Thu, 4 Nov 2021 12:12:59 -0400 Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25A84C06127A for ; Thu, 4 Nov 2021 09:10:21 -0700 (PDT) Received: by mail-io1-xd2f.google.com with SMTP id 2so4169766iou.1 for ; Thu, 04 Nov 2021 09:10:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=tUqoCGNnbxt+oywUiqReWRW9/LoLH193vc9R2cKGEpc=; b=oUHtN5yvmtuLU7Rt+p4AHRDksWqkQE+q3NqxcycZqtF9qmtzdBQ2tL5D+HqyyO/6T6 6RAH0Gm9enHnLZalZqd5vPhRiGo2BfuVG1/UtiQ5AlwtVyQxemDr2UAwLCeojaWJY//d HNaQIvQ9Z/HOjrGtUSDqmFuin9f0hb4Y5NwlAWG/Qb2plZ0RdYYhu1GhofX6SKx3Fcec jwV3+ZgpfWp9BUkGER+zSl8pSOY4QNbMW2htCUrZqDu7/lMD/Gm1y3hTLz0Q76u2LZ7Z UzOJSTuv5DMxl/thqh42/QR39gXTNNEE4XRxPV9P0rl7usFCGjCvM9eOZ5QGb5QuEpX8 Umtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=tUqoCGNnbxt+oywUiqReWRW9/LoLH193vc9R2cKGEpc=; b=tQYohWKmhjuVa0ujv3N23l8ko6JWjr3aOF2+aZMOkg+xrYEASJTjjvHhExmC+i7/op lP9Fkrcx/peUSqUH1VLJ2zWerpa0nUA3U0ZNX/P3witZOzwdGVvbZgW3+bO+c6PP2cau R359TNSN7wT7WXRKiFdvv6rKGxO+nlQj+gEku9ukprVnojhRZT4ygr9qVwK/AehJ2lgj tkbMn9ekVjXeenECRRgL9BANbTRPd2GoVJ+JF3axoSUWrwLzdNw5+GXqdmN7f5fD51TZ MlUsFvgjqtUorFLAjSf8lxnbVX8OaWWSgXuGU4zeqMvjqAP8wPJ/MpGVCcfsfSsJXOMo sTeA== X-Gm-Message-State: AOAM532/R6KNGZAX/R9l339p2CnVOBgTYZZFoHFqUfdH+cB2e7xCvhXX 7gJ2zApe3oDbn6SKxN2tjpd0Zg== X-Google-Smtp-Source: ABdhPJysdsBusunjAyJwyQgc6/PueGiLqEhbeMUOLxDa87sm4If+utgQP/RXb6DCfoSyUOfBj47T8g== X-Received: by 2002:a05:6638:d84:: with SMTP id l4mr4682907jaj.30.1636042220331; Thu, 04 Nov 2021 09:10:20 -0700 (PDT) Received: from google.com (194.225.68.34.bc.googleusercontent.com. [34.68.225.194]) by smtp.gmail.com with ESMTPSA id w11sm2661526ior.40.2021.11.04.09.10.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Nov 2021 09:10:19 -0700 (PDT) Date: Thu, 4 Nov 2021 16:10:16 +0000 From: Oliver Upton To: Reiji Watanabe Cc: Marc Zyngier , kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, James Morse , Alexandru Elisei , Suzuki K Poulose , Paolo Bonzini , Will Deacon , Andrew Jones , Peng Liang , Peter Shier , Ricardo Koller , Jing Zhang , Raghavendra Rao Anata Subject: Re: [RFC PATCH v2 01/28] KVM: arm64: Add has_reset_once flag for vcpu Message-ID: References: <20211103062520.1445832-1-reijiw@google.com> <20211103062520.1445832-2-reijiw@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211103062520.1445832-2-reijiw@google.com> Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Tue, Nov 02, 2021 at 11:24:53PM -0700, Reiji Watanabe wrote: > Introduce 'has_reset_once' flag in kvm_vcpu_arch, which indicates > if the vCPU reset has been done once, for later use. > > Signed-off-by: Reiji Watanabe Reviewed-by: Oliver Upton > --- > arch/arm64/include/asm/kvm_host.h | 2 ++ > arch/arm64/kvm/reset.c | 4 ++++ > 2 files changed, 6 insertions(+) > > diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h > index f8be56d5342b..9b5e7a3b6011 100644 > --- a/arch/arm64/include/asm/kvm_host.h > +++ b/arch/arm64/include/asm/kvm_host.h > @@ -384,6 +384,7 @@ struct kvm_vcpu_arch { > u64 last_steal; > gpa_t base; > } steal; > + bool has_reset_once; > }; > > /* Pointer to the vcpu's SVE FFR for sve_{save,load}_state() */ > @@ -449,6 +450,7 @@ struct kvm_vcpu_arch { > > #define vcpu_has_sve(vcpu) (system_supports_sve() && \ > ((vcpu)->arch.flags & KVM_ARM64_GUEST_HAS_SVE)) > +#define vcpu_has_reset_once(vcpu) ((vcpu)->arch.has_reset_once) > > #ifdef CONFIG_ARM64_PTR_AUTH > #define vcpu_has_ptrauth(vcpu) \ > diff --git a/arch/arm64/kvm/reset.c b/arch/arm64/kvm/reset.c > index 5ce36b0a3343..4d34e5c1586c 100644 > --- a/arch/arm64/kvm/reset.c > +++ b/arch/arm64/kvm/reset.c > @@ -305,6 +305,10 @@ int kvm_reset_vcpu(struct kvm_vcpu *vcpu) > if (loaded) > kvm_arch_vcpu_load(vcpu, smp_processor_id()); > preempt_enable(); > + > + if (!ret && !vcpu->arch.has_reset_once) > + vcpu->arch.has_reset_once = true; > + > return ret; > } > > -- > 2.33.1.1089.g2158813163f-goog >