Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1801020pxb; Wed, 20 Oct 2021 12:02:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0TQP1ElL7aDbi4vAvLSW0pqqZVV+huQQAEQZcsuo6PWaPNhJM2Pe9vn6kkFUYugTjxnc6 X-Received: by 2002:a50:e14c:: with SMTP id i12mr964437edl.125.1634756534335; Wed, 20 Oct 2021 12:02:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634756534; cv=none; d=google.com; s=arc-20160816; b=JPhPVvn+0+/Z4gahHJnb+Ko0mmbaU5Jm20n20WPPJrwZt5pz5TuYV3Ip9aMEwXjAUc 7HRmTMLCigiZvBk/FYhTelHpO2V5OZcNZ6rylvn5CMOWdIyiwPoT+HQCLTaAbJo+mvxF ILkjE8BRCRm5L8039JdBT9NpMfH16qqjxZW/sYooV35Xna5KCEjYXd1PX9zY5mZObzsv rP5h/8OKuMATq7BlhetdoUP0hUYOikk+fDHtEl83RGSz20gdI5VTCQFj7uTplITOwt9e A9IfalUTETuZgexl+QGfvo7XtrWftHpx6I1pSGl17g4cgFM7GBUrHJVCo2kg1CVEwJyw fsqg== 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=TvksdfctQPSKuZzYeC/pvdNqR1BvFx3obB1YwqOqH0c=; b=pFFo6l5vi0NKFudxaSMB0m+9soCBPIyj1gGULyW/IthG7UE3rGmhSL1yDoEjLe6xmP +e8iGuyEl+j3nvv7QNpWUE5m4sOg41ILsxYKSaT7Ejvh6O5b7adTgxa6krOCMHzDGlil Zd7761LrfUmt/2FW8LyL5tmMH2MrhtzVJMZbWWSe8f0aQcr50Sbu+1+YI1vSDDB4tZK+ faoEbF/khkj9QhwLtW7UjobrhbdF3k8HS29k9RC596k9MiJiNpzS6+0tWduOfOpzoIBI oheF9AI9TcLoxtnqupw97a/+h1x+ueQ1+vwGSYC1Qr85l8i+/hReiZYIyO20LW8HpTTq lhLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=UUCVwojQ; 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 q18si4006748ejz.555.2021.10.20.12.01.49; Wed, 20 Oct 2021 12:02:14 -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=UUCVwojQ; 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 S231455AbhJTS75 (ORCPT + 99 others); Wed, 20 Oct 2021 14:59:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231379AbhJTS74 (ORCPT ); Wed, 20 Oct 2021 14:59:56 -0400 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CDBAEC061749 for ; Wed, 20 Oct 2021 11:57:41 -0700 (PDT) Received: by mail-pj1-x102d.google.com with SMTP id u6-20020a17090a3fc600b001a00250584aso1216982pjm.4 for ; Wed, 20 Oct 2021 11:57:41 -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=TvksdfctQPSKuZzYeC/pvdNqR1BvFx3obB1YwqOqH0c=; b=UUCVwojQK6iOOMJ0L1siU++CuwXPjXWsrIJs2r8AaeLfe5opibSmFTqvoavMS9rDIP MLgua2jERLSwvJHLmz/4DCAEi6VZ4Nk6uM8G9N0BoeXvtDKkWAOvF8jRixeiNPmBbijK 54ppKEbGr59EOTlkQOomxerFYpsvlGPa7EuTbwB77MLCzUQYv6rzT4h9SMDhQCgRQxZu ehNTRQ3W+Irl1KPVGY6xGx/t3IyURScB85UCGBLsfqijfdv55+Hgi88A8UQu4I3QCnJl RuS4xxFjfTQcXhSkr4KnMKYMqVONQL7xfb2bF8Dp3/g+waBimrpjrjUfi4LTg7CYdoUq ZwQg== 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=TvksdfctQPSKuZzYeC/pvdNqR1BvFx3obB1YwqOqH0c=; b=jsQAUqptMrd2DXZpaAz2aNrs1+01IG8RTqm6jp93l/qiDcxJk/ctx7ryrSMXDf8hnS ojUoVplvool1lPGwwHf04uCkI9yZQEcF6iMbWYa52ChRHag/QZ0IX3PlVZBOJj4+Xibz AHtAqZOOsd2hOlOeDqiBhc8BkWNvAKksN+lHIYO4q7aZ+oDEBAD3XlddMnFVvMCyxrAA hxNjF58ZkzD7oixPAc/56qgtd1xP6klgUK+vCYLMZ1VDCF4gh0fUzeaFc8lOdyEqynXV sqRH4Uclu3v0Q6CGgbUzystAuK0FkGst9nVUz6pp7PRjEFnfs1xuqNyoqReltR8poZR7 337Q== X-Gm-Message-State: AOAM530+UrA7b3qopgYFW15pmt3CjYkTUMdk+710qErAj/eQ48ivX5mW bOEErX6TLeFAKpdWJ9WiUONPYg== X-Received: by 2002:a17:902:be0f:b0:13a:95e:a51 with SMTP id r15-20020a170902be0f00b0013a095e0a51mr827571pls.44.1634756261166; Wed, 20 Oct 2021 11:57:41 -0700 (PDT) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id z8sm3105052pgi.45.2021.10.20.11.57.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Oct 2021 11:57:40 -0700 (PDT) Date: Wed, 20 Oct 2021 18:57:36 +0000 From: Sean Christopherson To: "Maciej S. Szmigiero" Cc: Paolo Bonzini , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Igor Mammedov , Marc Zyngier , James Morse , Julien Thierry , Suzuki K Poulose , Huacai Chen , Aleksandar Markovic , Paul Mackerras , Christian Borntraeger , Janosch Frank , David Hildenbrand , Cornelia Huck , Claudio Imbrenda , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 07/13] KVM: Just resync arch fields when slots_arch_lock gets reacquired Message-ID: References: <311810ebd1111bed50d931d424297384171afc36.1632171479.git.maciej.szmigiero@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 20, 2021, Maciej S. Szmigiero wrote: > On 20.10.2021 01:55, Sean Christopherson wrote: > > On Mon, Sep 20, 2021, Maciej S. Szmigiero wrote: > > This should probably be a memcpy(), I don't know what all shenanigans the compiler > > can throw at us if it gets to copy a struct by value. > > Normally, copy-assignment of a struct is a safe operation (this is purely > an internal kernel struct, so there are no worries about padding leakage > to the userspace), but can replace this with a memcpy(). I was more worried about the compiler using SIMD instructions. I assume the kernel build process has lots of guards in place to prevent such shenanigans, but on the other hand I _know_ mempcy() is safe :-)