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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 30A64C433F5 for ; Thu, 13 Jan 2022 17:22:43 +0000 (UTC) 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=WbVY9ldVQa1Ndc92mb8YadU/NVDqhLKOZVImXVtrBrw=; b=PDDxet0HaupP0Z xSroELGfAt8yVH5eszdEJzU1Qho1yawsEhWgW5QJAke4YA2QjS0FAE35eJqrlyEdEytlQQ/vzE3Hz HYVFrWRXH3/aDLjqgefHNfqe4m/+KpZdKlFBozDD+ltNDOvZuxdy5tBL4+oobnVGSHrd4aESpZF5G R438e4q8JDCQdyeXXDzQ6zIX1Tv9HdFVALhPdzpH6LLY+zk4jPui8xF0OweU2z+fcWLALePEyaPfk 98KjOwdPiRfmIJnJgYyLJ2bj6PX+iKXjpEeubc7rr/hokEagATaxyTET/ZWTGPRynYGL2KPnyGLQA CGuX6YpjFyWio5mzwdkQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n83my-006jfp-Tr; Thu, 13 Jan 2022 17:21:29 +0000 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n83mu-006jdm-Hq for linux-arm-kernel@lists.infradead.org; Thu, 13 Jan 2022 17:21:25 +0000 Received: by mail-pg1-x534.google.com with SMTP id i30so432442pgl.0 for ; Thu, 13 Jan 2022 09:21:24 -0800 (PST) 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=fbtEGzJF4Pri1PYcfPX7asBEf22RcTqncsyblqc+OvY=; b=Sl9FnTulo3H/YWpf/aLfhSezCJjNzfPIcyIfQnWaI/T+ls4BqPWyqk0HJpiNM9kBV3 yGWtR900nHAhsuqatRtea8l3DKjGXWlo8s5kuMoFNZ7F9GpaNNS4XkSbvkXTqsrf2Zt2 APxjvu6wgUo4v3/0Ed+fzz74FUPs60sq9kEb5Q6U4T6Wfw2sHFVn2yOiqSEIvjuhjNo4 kuPwFSKBgU+46N6R3bu0BV7BPQos4gfZusOXH4QF94O+R0NhEUt2Q27T1c7bwrI8vByj u1niyPmODAf23UyQipBFWfpwwWDFqW/fDcCcLJAKR6WcuHkeCsBMoMFkcTlmmC0+SUbj kR/g== 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=fbtEGzJF4Pri1PYcfPX7asBEf22RcTqncsyblqc+OvY=; b=jY7Nc8aO8KaRa0dWCbbWhdJfQ0iIqWHYj0a0fPf5cobOGYkpLPg8+Cnhn2tXO7X0rD nD2omgemT/wxtXaQkvK4CuRHaLO9/d/IZBQe9ZFmzJWzNPhXibCtp1s4f0BMzajEIMDZ OOxuYis6QsL7t1oJc8AK/CrIhFThqPbuYfC2h35vbRpUfKSycMi/WKXRSQdoCsnt5U34 pbyTDC5ZCPbOFxrwloKO9i7soazM7T4V7GdwBQm1DtYOpCI0ylMPBvGglzqu/LWbtT1i JBCjeyQ3258uU+kYVpyBvMAIX0bfD2zpfkCiDH1TisgcfUPy2rlFugEkGQnfCF5+lJxr 0WBQ== X-Gm-Message-State: AOAM532T0MWhf1oJhloq/4dUT49K4OkeJ/L6kkB6mJirrMF2fkUzXnWK lmQcmMjyFqtiZ22Uqfqvw26zyH2ZMzx5fg== X-Google-Smtp-Source: ABdhPJwscB6iGP0ZkbE0k3eKaRnQ7Ca7BDedLEYyrWxbsoa7id33e6ZYFRtTIaHRtcelXaAQ3lqEHA== X-Received: by 2002:a62:178a:0:b0:4c0:25a5:d389 with SMTP id 132-20020a62178a000000b004c025a5d389mr5156670pfx.1.1642094483546; Thu, 13 Jan 2022 09:21:23 -0800 (PST) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id pi15sm3309892pjb.43.2022.01.13.09.21.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jan 2022 09:21:22 -0800 (PST) Date: Thu, 13 Jan 2022 17:21:19 +0000 From: Sean Christopherson To: Raghavendra Rao Ananta Cc: Jim Mattson , kvm@vger.kernel.org, Will Deacon , Marc Zyngier , Peter Shier , linux-kernel@vger.kernel.org, Catalin Marinas , Paolo Bonzini , kvmarm@lists.cs.columbia.edu, Linux ARM Subject: Re: [RFC PATCH v3 01/11] KVM: Capture VM start Message-ID: References: <20220104194918.373612-1-rananta@google.com> <20220104194918.373612-2-rananta@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220113_092124_629220_38868569 X-CRM114-Status: GOOD ( 21.02 ) 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 Wed, Jan 12, 2022, Raghavendra Rao Ananta wrote: > On Tue, Jan 11, 2022 at 11:16 AM Jim Mattson wrote: > > Perhaps it would help if you explained *why* you are doing this. It > > sounds like you are either trying to protect against a malicious > > userspace, or you are trying to keep userspace from doing something > > stupid. In general, kvm only enforces constraints that are necessary > > to protect the host. If that's what you're doing, I don't understand > > why live migration doesn't provide an end-run around your protections. > It's mainly to safeguard the guests. With respect to migration, KVM > and the userspace are collectively playing a role here. It's up to the > userspace to ensure that the registers are configured the same across > migrations and KVM ensures that the userspace doesn't modify the > registers after KVM_RUN so that they don't see features turned OFF/ON > during execution. I'm not sure if it falls into the definition of > protecting the host. Do you see a value in adding this extra > protection from KVM? Short answer: probably not? There is precedent for disallowing userspace from doing stupid things, but that's either for KVM's protection (as Jim pointed out), or because KVM can't honor the change, e.g. x86 is currently in the process of disallowing most CPUID changes after KVM_RUN because KVM itself consumes the CPUID information and KVM doesn't support updating some of it's own internal state (because removing features like GB hugepage support is nonsensical and would require a large pile of complicated, messy code). Restricing CPUID changes does offer some "protection" to the guest, but that's not the goal. E.g. KVM won't detect CPUID misconfiguration in the migration case, and trying to do so is a fool's errand. If restricting updates in the arm64 is necessary to ensure KVM provides sane behavior, then it could be justified. But if it's purely a sanity check on behalf of the guest, then it's not justified. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel