Received: by 10.223.185.116 with SMTP id b49csp5447571wrg; Tue, 27 Feb 2018 13:33:50 -0800 (PST) X-Google-Smtp-Source: AH8x224KhciE92t7f8wV83IY1UlL07NXEwZJgnf1+kadYAl6H8aty9fAGehW7k0p42iIYWTVHTAT X-Received: by 10.101.92.72 with SMTP id v8mr12253499pgr.153.1519767230497; Tue, 27 Feb 2018 13:33:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519767230; cv=none; d=google.com; s=arc-20160816; b=q1gdHAxkIM+nEle85m20CSm/DLdFL/A2PiUOGi9kgbr/D09L+mXJw/tK/SnWPR5h1H 3PqkWEFubzE7rtMa/GSNpHOQ4ybSaBdKb1xG8886dQBCaZH+2qgepO2orPH7qYCnOvhb RahJf5c4nWugZcHocDnppx3J/btFONgeCX3m95TG8/R7/Kc9NljhcFcUYxVpNSp3fQrW 7SGeZ2m3wZ3LQDXwCCAW/HWzWM7u+mEVz4u6MzAgf332qEQWhuQi/Qh7sJiLJx+E09U0 MVzWrdM+t6IB2671HGYQ7pNry677h/PEolVCHfyaiTSoLUTV4eDscQLRpfQXsAjRTSuO UFnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dmarc-filter :arc-authentication-results; bh=S8Y+zN2yTd0nLpiInjjrfY0xNW6t+GDjv5HlFkk/duY=; b=GAlA7LNDgZXVsRNP811R9wpsDLXibM970HoBJ+dgHu+ayM0f0tRGwA7W7f46qRB0nO /lMyzP/L9Ov/buRW0Ax+upMedRrNvLIBuneEaQrR5NwiupQkp3K3cfoF2aLyRAWWj4rk 1l//f2rdnefn8XxRZTixTnu9S7WYRVX1llj1uFmsoV4fj/KYmx6b2Ra9eEjognTU9j0T PJ1Cfnq90LUrVshsQ1OfoYOoDx9OibI92KIkRTvTcz92Q2ItblQlEhfRiu3bhdFwUJJh vadmEG73bEMJdIwXuaWY4Oc0C0I/g4DD8l+fw5ctbesjEBXtVG0f8fQ6V75PmHOSIxzZ 8x7Q== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h91-v6si80606pld.202.2018.02.27.13.33.36; Tue, 27 Feb 2018 13:33:50 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751885AbeB0Vce (ORCPT + 99 others); Tue, 27 Feb 2018 16:32:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:42140 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751139AbeB0Vcd (ORCPT ); Tue, 27 Feb 2018 16:32:33 -0500 Received: from [10.135.48.227] (unknown [12.248.85.146]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BB9562168D; Tue, 27 Feb 2018 21:32:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BB9562168D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=sstabellini@kernel.org Date: Tue, 27 Feb 2018 13:32:32 -0800 (PST) From: Stefano Stabellini X-X-Sender: sstabellini@sstabellini-ThinkPad-X260 To: Boris Ostrovsky cc: Stefano Stabellini , jgross@suse.com, xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] pvcalls-front: 64-bit align flags In-Reply-To: Message-ID: References: User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 27 Feb 2018, Boris Ostrovsky wrote: > On 02/27/2018 02:54 PM, Stefano Stabellini wrote: > > We are using test_and_* operations on the status and flag fields of > > struct sock_mapping. However, these functions require the operand to be > > 64-bit aligned on arm64. Currently, only status is 64-bit aligned. > > > > Make flags 64-bit aligned by introducing an explicit padding field. > > > > Signed-off-by: Stefano Stabellini > > > > diff --git a/drivers/xen/pvcalls-front.c b/drivers/xen/pvcalls-front.c > > index ca5b773..aa07b2a 100644 > > --- a/drivers/xen/pvcalls-front.c > > +++ b/drivers/xen/pvcalls-front.c > > @@ -78,6 +78,7 @@ struct sock_mapping { > > #define PVCALLS_STATUS_BIND 1 > > #define PVCALLS_STATUS_LISTEN 2 > > uint8_t status; > > + uint8_t pad[7]; > > Does this guarantee alignment (for either status or flag)? Yes: status is part of a struct and a union. Unions and structs have the alignment of their most aligned type. In this case they are 64-bit aligned, as some of the fields are pointers. The padding makes sure that flags is 1+7 bytes from it. > > /* > > * Internal state-machine flags. > > * Only one accept operation can be inflight for a socket. >