Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3703533imu; Fri, 30 Nov 2018 04:50:49 -0800 (PST) X-Google-Smtp-Source: AFSGD/VHbzRrveOpn/kd5Lc2IMAEvHrc95BMm6UyT3MAnRozGfEuBu5M15aStTjYwM3JhkluSOkN X-Received: by 2002:a63:5a57:: with SMTP id k23mr4730284pgm.5.1543582249642; Fri, 30 Nov 2018 04:50:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543582249; cv=none; d=google.com; s=arc-20160816; b=PuH33Hqn1Z4wBhUNLfkUGvlDvqiEy3JBQdQkg/HaPHmKxPBdQmvfCA/QxRNcMa1fi+ apfG1EKQ/rFHOtiuHVlcKlSPDqcFw5Agh4DdstW05e/4DvZgBuvqyzogwoPrzfZ6jFXX 5gHKCyJwXTi+j/7Tb5NgYg2SzQ793tQcWMluJLPF9/0KYFIOQTAzcn85rOv41qISMZR2 NZz60XH9E+OEu/uEul4LXuSRfbvEfBrAdDKSeQXSy58RDue3cZsvFULg7LbPey3R6OHP GXItETPxK3c77u6OzqyPPRurqYgIKcuA581vs9vpWs4Uij9sWS1oafuX1fwDrbFzyeJy QP3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=XGQlhogHr/6FyZN4TSi3YOLsERX/9VnuMQbySPbOh0w=; b=DREP3xlvYYSlHuD6ifyBgDeOcDSsIb3WeoS1zjieEdDTXacCHAOkv4mr9FWnOa5Ho4 mPMzaEqW4yHE2XSJuyHuLcBD3Kj1ldbTYviMLKoe7QL3icDAbtsAxHalqK9E8M50qMFZ rt35eIXZcYeHpZflVQfEhPqOWEspB79D90JOxoJsjOwqkUDwqBzFe0nGozivRaofp4I0 2bCBmqc82hqPJpIzzQ+71HlKZhWdGtsv9g2UW7tsEc/c/PooXScx+NqJ5Pq4M2T3TOcI lqnfaH8HSpArHxNfYMLL+ovScVQYd2iiRQGszcmRkBY+9EXMkA2X0xkFvDWP1/eAyHtr A6nw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q189si5384112pfb.62.2018.11.30.04.50.33; Fri, 30 Nov 2018 04:50:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726719AbeK3X7J (ORCPT + 99 others); Fri, 30 Nov 2018 18:59:09 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58564 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726555AbeK3X7I (ORCPT ); Fri, 30 Nov 2018 18:59:08 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B7F8316974D; Fri, 30 Nov 2018 12:49:56 +0000 (UTC) Received: from vitty.brq.redhat.com.redhat.com (unknown [10.43.2.155]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 42A661054FD4; Fri, 30 Nov 2018 12:49:54 +0000 (UTC) From: Vitaly Kuznetsov To: Thomas Gleixner Cc: kvm@vger.kernel.org, Paolo Bonzini , Radim =?utf-8?B?S3LEjW3DocWZ?= , linux-kernel@vger.kernel.org, Roman Kagan , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , x86@kernel.org, "Michael Kelley \(EOSG\)" , Nadav Amit Subject: Re: [PATCH] x86/hyper-v: define structures from TLFS as packed In-Reply-To: References: <20181130121511.12331-1-vkuznets@redhat.com> Date: Fri, 30 Nov 2018 13:49:52 +0100 Message-ID: <87y39awwzz.fsf@vitty.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 30 Nov 2018 12:49:56 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thomas Gleixner writes: > On Fri, 30 Nov 2018, Vitaly Kuznetsov wrote: > >> Subject: x86/hyper-v: define structures from TLFS as packed > > Please start the first word after the prefix colon with an uppercase > letter. Also structures from TLFS doesn't make sense to me. Something like > this: > > Subject: x86/hyper-v: Mark TLFS structures packed > >> Without 'packed' compiler is free to add optimization paddings and re-order >> structure fields for randomization/optimization. And structures from > > s/And/As/ ? > >> hyperv-tlfs.h are used for hypervisor-guest communication, we need to >> ultimately forbid such practices. > > That whole paragraph reads a bit strange. Something like: > > The TLFS structures are used for hypervisor-guest communication and must > exactly meet the specification. > > Compilers can add alignment padding to structures or reorder struct > members for randomization and optimization, which would break the > hypervisor ABI. > > Mark the structures as packed to prevent this. > > Hmm? Sure, will do v2! > >> Suggested-by: Nadav Amit >> Signed-off-by: Vitaly Kuznetsov > > Other than that: Acked-by: Thomas Gleixner Thanks! -- Vitaly