Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp2746587rwi; Tue, 1 Nov 2022 11:12:37 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7wzEl++d1sO3WX8e1aL+TgwnKM32qVQa/20J5ohIOKZydMJESADZNPy5+OOipMgRcWNlTV X-Received: by 2002:a17:903:260b:b0:186:fe2f:279f with SMTP id jd11-20020a170903260b00b00186fe2f279fmr19874535plb.166.1667326357382; Tue, 01 Nov 2022 11:12:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667326357; cv=none; d=google.com; s=arc-20160816; b=WQtUxAm5O0kjwJev38ASDKgbs5Trp3ZFZ+G/YGj2PWUVyd0CPbHndlr6fZD9IY+7nu ZzL6Hs1hUbfNj7obhk4VQE1D5egIN0OU0YX+Moe/bTnq1uYeEtrsGPJQwKAOzi3bomu/ MYa8XVy/bTuGaZForE0kVRn4GbBy9mu0NlHTxrwYk9y3aCwO2G7O/9pB5FdhMg8NBfKh n1pZJ0jCUX7LSSgYDWH1B2RW8Hu1u+M/9xXJU/vsz1jx1ieYy4liMPi7uuFE2VSCPwwI X1OydtuyAr3/m5J/yBALztQzIkkyK2S7ZDkfhJENp76yiyniYwbv8cEqi2EcD637cB/G wuxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=B6yv38rBcXg8ajx2YDuTgCNAFEG5qCJwSqMKG6SLY/Q=; b=kd8p0HVpfSWQCygQd/CFVNHm7x6klI01AYJgub6CYMi8wdzHAr86Vq9qoqviFIVC/7 cvzuKgx7jg1heZAithv3lEO8mdlvDNQPnPqstjdQaodZ5UOyDnzxYNgduVEJqEftUMTR OaD5EguQjs/J9UxWbKoFP6M+RVkYQslcEwXL8r6ZX1jjbGQJNpJZkf7KuHAxjOPh8yMc WCqAzEH2plcyKmP3Ql3h2bYPhGWGj1IWbFW5j0nmtE5yM8TkUFNfSUpDiDnVgayZa3LW TJqGe5I59zYoxuqTCApfPDq+gEUzCCxRnJHZb7HWSj+eHb2yGc3USwxwBVtK3Uw4cFfr /4Rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=oirac5wG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q17-20020aa79831000000b005627d896458si11209913pfl.142.2022.11.01.11.12.24; Tue, 01 Nov 2022 11:12:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=oirac5wG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S230419AbiKASDy (ORCPT + 96 others); Tue, 1 Nov 2022 14:03:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230269AbiKASDw (ORCPT ); Tue, 1 Nov 2022 14:03:52 -0400 Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE21818E29 for ; Tue, 1 Nov 2022 11:03:51 -0700 (PDT) Received: by mail-pf1-x436.google.com with SMTP id b185so14161058pfb.9 for ; Tue, 01 Nov 2022 11:03:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=B6yv38rBcXg8ajx2YDuTgCNAFEG5qCJwSqMKG6SLY/Q=; b=oirac5wGLIY4i7en0pMoj97TKnKq5f/AWRFqN4VjYjwFJLSoZ5tysow4ZthFobpB+C OT2R7Lw6Tj2fGOjQC+xOG98LCLhmIwEezmGHnhlQS9/wSEox5HqG3Qm0XqGl2Sh51yvd B3MmVErdZm05tk1aomEDBL8K7UR++WC4l1Q4JyGEu0Tryq9rEHAhcRL3zECb5eZercVE oKh2MTW00uc7UUaQe6BVZyRldAUz5rnjgecL7jLu2eCTtOGzlNwQj93/PGOQsz1DnKLH JJ5ZoYcKx6Naccvr6z1KH1wCt3w7It0+gROA6MwGCmRk51ZOX+kTQviVFpc8c03w5MmN T/gA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=B6yv38rBcXg8ajx2YDuTgCNAFEG5qCJwSqMKG6SLY/Q=; b=GEmpuyfe+YN01uJ7WfKa2omgUyuBbukQh5dudu6iApuq2T/E5sHI3Ga5OLb2HRy07G svXprp6Z3WAfXd/b03u39ei6ko+zq2m37BgOPRfAsfYf23wQ68D/qbgmrOoBo2AqGYV3 3V+VqJX7ojF+jZ4upd2USHOdR+L1GULeSrDtY95jyxLAaF+wJ2DVJqC4NvYw0Mn+lpxG 3UiQ7+IdKsWxApEfqka/h6ZcqkXdWvFYpnemT+LhxtegQpdkQ3WeiQ3cazhJcVHDwlNI VoRG2lJ0eZzsQfP+qNfssmVhHo7QG+oiVnf1VVe4BsHeQAZztOEOERrPPOGEb7mQgIM4 6B1w== X-Gm-Message-State: ACrzQf3ayauzSXrqEiWv8pUQ8ZXtIY3aNBHQ1pUX9QPqIC+EIUJ26zlP v1VNU2Ro8xNZzCO/XSGonL43zQ== X-Received: by 2002:a65:56ca:0:b0:439:169f:f027 with SMTP id w10-20020a6556ca000000b00439169ff027mr17974497pgs.580.1667325831175; Tue, 01 Nov 2022 11:03:51 -0700 (PDT) Received: from google.com (7.104.168.34.bc.googleusercontent.com. [34.168.104.7]) by smtp.gmail.com with ESMTPSA id g6-20020a625206000000b005633a06ad67sm6808026pfb.64.2022.11.01.11.03.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Nov 2022 11:03:50 -0700 (PDT) Date: Tue, 1 Nov 2022 18:03:47 +0000 From: Sean Christopherson To: Josh Poimboeuf Cc: Paolo Bonzini , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, jmattson@google.com Subject: Re: [PATCH 1/7] KVM: VMX: remove regs argument of __vmx_vcpu_run Message-ID: References: <20221028230723.3254250-1-pbonzini@redhat.com> <20221028230723.3254250-2-pbonzini@redhat.com> <20221101173204.w7yuoerkafxonyzx@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221101173204.w7yuoerkafxonyzx@treble> X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 01, 2022, Josh Poimboeuf wrote: > On Mon, Oct 31, 2022 at 05:37:46PM +0000, Sean Christopherson wrote: > > > diff --git a/arch/x86/kernel/asm-offsets.c b/arch/x86/kernel/asm-offsets.c > > > index cb50589a7102..90da275ad223 100644 > > > --- a/arch/x86/kernel/asm-offsets.c > > > +++ b/arch/x86/kernel/asm-offsets.c > > > @@ -111,6 +111,7 @@ static void __used common(void) > > > > > > if (IS_ENABLED(CONFIG_KVM_INTEL)) { > > > BLANK(); > > > + OFFSET(VMX_vcpu_arch_regs, vcpu_vmx, vcpu.arch.regs); > > > > Is there an asm-offsets-like solution that doesn't require exposing vcpu_vmx > > outside of KVM? We (Google) want to explore loading multiple instances of KVM, > > i.e. loading multiple versions of kvm.ko at the same time, to allow intra-host > > migration between versions of KVM to upgrade/rollback KVM without changing the > > kernel (RFC coming soon-ish). IIRC, asm-offsets is the only place where I haven't > > been able to figure out a simple way to avoid exposing KVM's internal structures > > outside of KVM (so that the structures can change across KVM instances without > > breaking kernel code). > > Is that really a problem? Would it even make sense for non-KVM kernel > code to use 'vcpu_vmx' anyway? vcpu_vmx itself isn't a problem as non-KVM kernel code _shouldn't_ be using vcpu_vmx, but I want to go beyond "shouldn't" and make it all-but-impossible for non-KVM code to reference internal KVM structures/state, e.g. I want to bury all kvm_host.h headers in kvm/ code instead of exposing them in include/asm/.