Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp1027695pxb; Thu, 9 Sep 2021 18:24:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy9qXPV0EV6Oa9ap7ZjiftwlpNK2z8/B0/SQ2pjO1VVt9o5UDII2pYhcmqJjACY9WI0hN7q X-Received: by 2002:a92:c14a:: with SMTP id b10mr4365655ilh.176.1631237073413; Thu, 09 Sep 2021 18:24:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631237073; cv=none; d=google.com; s=arc-20160816; b=b/07GmKvuWKOSctRD9rJIo/n+eEVCT05Bbqzc783NU0OhhCea0jyPkLP+72df81rUT vJR6+FQzkyaXVYb2/gZkRqU9ugv+jpIT1eqBosur71Yi/Vy8mdw01MSDlGpgUlpf0rcy 5oVMq7hciK1cGQTsnNxbrKH4dw161N8s4ycU7TAclRxodtQFyoT4R3wXTlU9WKlCRgNE YWj9Ou/kS8C+oh0aF6FrJdpuuGGP73PtyLtjNDEVXlfWpa/dkYGvWEi7w1t4wdXeJOSY N4nsxh8deXx7dN8IPPnXbR09WmdVRXjI6tXyWCbpnWPjffDPQUENX2PP9fW74Bpt0ho+ 2jbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=cGAyUL8bp8BmihGQbVBB5Ud51RVhdqCDb2c9LcQm9Qk=; b=SRYZHsClucUvUgTdcCmr2RSif3pDvirn9XPVf8EQp2MJ/K8OoiMXKpIiawZHPuJugE j460Q2hhWq1dCYryUZ+ljN9781jIvpvBRvgPcU4sKbdLjmRVwLcbVdQut4K/ZLoFji+B 8zmTRfa0UtB4ae73XFj0kcfLVfF2Vs0RunYBfWpSVk+ghJd2x9H06VPH6yos1KZWP1sQ iUECYDjPPRhIvoZJjQoITKSU8sfWxIDOlSZSa2YxK5DUFUMYUiEqOj5lToH8KDvXoMiZ 1SuFhXg2GvzvYJfMnMPUDY50h35DgWYMKh72CtGJrVOChJES9fdjQ2G/wPNpy6QmtBvX zu2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=EzrrGCy8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c18si4100855iod.38.2021.09.09.18.24.22; Thu, 09 Sep 2021 18:24:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=EzrrGCy8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238907AbhIJBXX (ORCPT + 99 others); Thu, 9 Sep 2021 21:23:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234799AbhIJBXR (ORCPT ); Thu, 9 Sep 2021 21:23:17 -0400 Received: from mail-ot1-x330.google.com (mail-ot1-x330.google.com [IPv6:2607:f8b0:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D67EEC0612AB for ; Thu, 9 Sep 2021 18:16:08 -0700 (PDT) Received: by mail-ot1-x330.google.com with SMTP id c42-20020a05683034aa00b0051f4b99c40cso192041otu.0 for ; Thu, 09 Sep 2021 18:16:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=cGAyUL8bp8BmihGQbVBB5Ud51RVhdqCDb2c9LcQm9Qk=; b=EzrrGCy8DmzpGQL1ZpWiLsC+VVQlDGA9wIY9fvS3uHzBRrbihpPVv0mLc8LrobN/MV S31Bg81HQmiNst71q25BlZIRh+1aeDmX2FhCgAX1ZKTRp9H/6nIl5k1UvDI5cnhtiNB+ AEu+hMCWuB8s2IGeWIC3smZcljMRJOb22RzlwxpxRsrxIHPt2OyGVMjoNgtneyc+sz48 A2abUpyeigP9ggBUTNYzzuMrMZrDW8cAOTIYZE24tgd7RdpdBZEG9LfQRRhb+4lw8PrW F8t9Y0PE/fR4rbuQ+XgvQyzUieVQ0gb64uMPXYTk14IAbwB4xyKS0geofNVPhDJ33OOj GuuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=cGAyUL8bp8BmihGQbVBB5Ud51RVhdqCDb2c9LcQm9Qk=; b=XG4KsOU+PlyqVPLMdovqOFg6GIfSDGiGDNpOcsK9SDT3pJyJNaOqzaL18+6HhUWo0a cX4a8sSQeDCL1sctS1w4FV/3mfS6jJ+9IpualtITlZiSvXVDx2ok+i3Atye5pwbqdRok jmFqHyP/PK4q8/Wc6mpbTOmtUpKk0hwEfKOZ4F9qN47VMUv6kYYuIO/g3H9rwQ/T19OG +bmxt/0FqdaTDY/r3jvA9EZ4sTXg3Ks36m+gqEUWtPWqVuRBzYRNRD+D4BJViP73VZe+ USbN7fl5W8s8BghaRdkOyJGJImMlLNb5s400lO0XZe/SnVkVgmvt49x6i+dn+mlAUVge /g+A== X-Gm-Message-State: AOAM531QOt4fHLjAR1zTfMnBJMkafEBok4/W81VXAzGvbVEEbaVhq90b pWJKkZYvAOPOYWGoLzecZYUQt1aT3wJyNiG/BCXdEqvHfxo= X-Received: by 2002:a05:6830:2b24:: with SMTP id l36mr2545318otv.25.1631236568003; Thu, 09 Sep 2021 18:16:08 -0700 (PDT) MIME-Version: 1.0 References: <20210902181751.252227-1-pgonda@google.com> <20210902181751.252227-2-pgonda@google.com> In-Reply-To: From: Marc Orr Date: Thu, 9 Sep 2021 18:15:56 -0700 Message-ID: Subject: Re: [PATCH 1/3 V7] KVM, SEV: Add support for SEV intra host migration To: Sean Christopherson Cc: Peter Gonda , kvm list , Paolo Bonzini , David Rientjes , "Dr . David Alan Gilbert" , Brijesh Singh , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > + dst->asid = src->asid; > > + dst->misc_cg = src->misc_cg; > > + dst->handle = src->handle; > > + dst->pages_locked = src->pages_locked; > > + > > + src->asid = 0; > > + src->active = false; > > + src->handle = 0; > > + src->pages_locked = 0; > > + src->misc_cg = NULL; > > + > > + INIT_LIST_HEAD(&dst->regions_list); > > + list_replace_init(&src->regions_list, &dst->regions_list); > > +} > > + > > +int svm_vm_migrate_from(struct kvm *kvm, unsigned int source_fd) > > +{ > > + struct kvm_sev_info *dst_sev = &to_kvm_svm(kvm)->sev_info; > > + struct file *source_kvm_file; > > + struct kvm *source_kvm; > > + int ret; > > + > > + ret = svm_sev_lock_for_migration(kvm); > > + if (ret) > > + return ret; > > + > > + if (!sev_guest(kvm) || sev_es_guest(kvm)) { > > + ret = -EINVAL; > > + pr_warn_ratelimited("VM must be SEV enabled to migrate to.\n"); > > Linux generally doesn't log user errors to dmesg. They can be helpful during > development, but aren't actionable and thus are of limited use in production. Ha. I had suggested adding the logs when I reviewed these patches (maybe before Peter posted them publicly). My rationale is that if I'm looking at a crash in production, and all I have is a stack trace and the error code, then I can narrow the failure down to this function, but once the function starts returning the same error code in multiple places now it's non-trivial for me to deduce exactly which condition caused the crash. Having these logs makes it trivial. However, if this is not the preferred Linux style then so be it.