Received: by 10.223.185.116 with SMTP id b49csp5456884wrg; Tue, 27 Feb 2018 13:45:40 -0800 (PST) X-Google-Smtp-Source: AH8x224s1dW3y+Lt0Zr66tGbCuno1emWA87s7gROpJZWSOlq5v4MXGvBO5FgBuTnQyHHotRtX8Is X-Received: by 10.99.117.6 with SMTP id q6mr12289028pgc.146.1519767940790; Tue, 27 Feb 2018 13:45:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519767940; cv=none; d=google.com; s=arc-20160816; b=neE5RVcGs4SpaiLxuu+TBP/22I9EB5AuOL5vczlGDRXO7hKXC+PJ4Pg16us8fSkaOx 1YdLVYSBKljiji9Q3f8So6L3zZg+XjNooqQHWitqstb90rTcYkHRyDG64U2+3RIbHGJI 39ZCkcWBibdY3j5IDXoKAE5DitqVQwdLx3IZPMnWxHBaZxlyODfpkqLJ1GU5jbZao5ZQ i79t8QoRq+hPTMtIDVL2R9S2adkQJJzuxnRMOJ68EbFEoCr8WO666gy3TFJRtBeJS7x1 MwK7Qhy4z0r6o1lUmk01C/UtKqv60w3AU9AaDVxeuQsLdLPBN2I7owDB8pyFkoLWPF/h xSrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=iIU2xaL+pAT0smO+4jwqaUIJAmTe6+jEy6Us3W1SZGY=; b=b/N0zHarrPZc93SOX3XdkxIKAuISpajngVGD+B2PgPYZd6rkYPfxdcpGq5ZFiKRe/b rQsDb4mtKi4e488/sG3kAUiGSxsWDnQPqrU0yE+bQGuuSP2dFb6wuJzi/onIZbF62hyo 312t6wc0orD3DcX9lfYx7UhI4mH3ZqJLiTz6xBfFJ8epl/3DasfNAMQpM78cSNj2S0SP Zqath4cir/v0YC1VcavWkvnQkRqhe5cf5bpGntrHLx+ew1EfQ4XYZq0qjAf9Ne3Fratu lOkxNxHjgFQ0j977QT1jT6I0fRgbRDEW/kXGq60lreJEIMDZ6FlL7yF+f4vrqMElH3DO emAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=d/Zohhxz; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w3si70581pgb.419.2018.02.27.13.45.25; Tue, 27 Feb 2018 13:45:40 -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; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=d/Zohhxz; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751777AbeB0Vok (ORCPT + 99 others); Tue, 27 Feb 2018 16:44:40 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:47996 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751675AbeB0Voj (ORCPT ); Tue, 27 Feb 2018 16:44:39 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w1RLg2iK065195; Tue, 27 Feb 2018 21:44:34 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=iIU2xaL+pAT0smO+4jwqaUIJAmTe6+jEy6Us3W1SZGY=; b=d/Zohhxzc5aa+RcWJdjFICvjO27MKcb8cnQDlt4X/rQ6NGaG/DPdRAQN5ELzfnyZBroF Ljr3zqzZwYpmI2N9K1GmrEC4f4TooFgsx7sSuN6HEcfXA1Nn5GkqYUtAUD+xVrnkvtdK /V1fcHlXNCOAuSTxskreMxGqAPiad+sMfmKPS36ljy2SUw+6zbZgNOtMGIaz7gEHMBwU NdyP5FBAoZ6f0WqKUEc9py1sFMgvThQK6Oxg12w946fX/92PvwbXynuLl3GKCRmCkwSb a0T3NkNmrt04j8w+y4s20DlZc6VqnCXHWFsG2psZ2B2iOCN3pPtqqUqX1KzGqPk06bTL 0g== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2130.oracle.com with ESMTP id 2gdbsc147b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Feb 2018 21:44:33 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w1RLiU5b024541 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 27 Feb 2018 21:44:31 GMT Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w1RLiT8C031836; Tue, 27 Feb 2018 21:44:30 GMT Received: from dhcp-burlington7-2nd-B-east-10-152-55-162.usdhcp.oraclecorp.com (/10.152.32.65) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 27 Feb 2018 13:44:29 -0800 Subject: Re: [PATCH] pvcalls-front: 64-bit align flags To: Stefano Stabellini Cc: jgross@suse.com, xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org References: From: Boris Ostrovsky Message-ID: Date: Tue, 27 Feb 2018 16:45:08 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8817 signatures=668681 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1802270268 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/27/2018 04:32 PM, Stefano Stabellini wrote: > 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. OK. What about adding __attribute__((aligned(8))) to both (with a comment explaining reasoning)? -boris > > >>> /* >>> * Internal state-machine flags. >>> * Only one accept operation can be inflight for a socket.