From patchwork Tue Jan 7 17:39:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 11321515 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4BF90138C for ; Tue, 7 Jan 2020 17:40:25 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 27D7A20848 for ; Tue, 7 Jan 2020 17:40:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bHHqAz7M" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 27D7A20848 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xen.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iosp9-0004cW-E5; Tue, 07 Jan 2020 17:39:23 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iosp8-0004cP-9h for xen-devel@lists.xenproject.org; Tue, 07 Jan 2020 17:39:22 +0000 X-Inumbo-ID: a0caea22-3174-11ea-bf56-bc764e2007e4 Received: from mail-wm1-x342.google.com (unknown [2a00:1450:4864:20::342]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id a0caea22-3174-11ea-bf56-bc764e2007e4; Tue, 07 Jan 2020 17:39:17 +0000 (UTC) Received: by mail-wm1-x342.google.com with SMTP id p9so421731wmc.2 for ; Tue, 07 Jan 2020 09:39:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=44vjlrhcAqVkUEK0qSVPAI0qz3c0oR69g1CT4yXLODk=; b=bHHqAz7MRO8J1ArPuQ+z4f9LNuMq7QlEe8YPsiIgXlPNR7kfEm5JDkb/KTgyLYGCDk hMt4edQAvN+rmwLyn0WXB8BH/symGeLCCg6LvzrT6BJEz6ZKEt5xRFuZSEv722lwSVg4 4qdiBP88QX65FG+Kzuc5R/PUfKfs6mcMYAy4rJoIoV0UzpfaEEZd9FxxJ5xj2Cq2Pxjw qi5Z1A+d9ze91qyhXVRKzZpjuxTxuLL5hNP4VrjqmHLSkfuzQ0Bk8HNOV+fgBqDKODBN YOz7JBj2GRdG8wbyZSwyx0PqVBkZJGMPs8Ty17CzevuhTzwDsHwgztxNuGZIhBKlCz4Y d1fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=44vjlrhcAqVkUEK0qSVPAI0qz3c0oR69g1CT4yXLODk=; b=CmkrxNDBIqc2ClPc6yX0mYCWM7EF9zDGdJnQ1NpyPyWwASpDIy9roJUoW8VGqWcxJp W/vqp6KaE+C5i6juCpLX8boTodCBoJ3TjQaDI7Ltuq5NQf7Kbt6zKejOs4BoUU7L9/33 ykzwXZ9I55vqr6aVWVrzlEWB3MWl/vik/C2J1xatlpahMPu0OfB2dhlAYyAEDeqNyUXM 2K3PJspkscB0UlTXJHRWFCbE3td8WreK5Mwt5lSI2DcQw8Is+ft0U0Gg79ybDzyFhS7O BNdCtf8kJbVB878ey333QhJlAmAx0RZtjOyalGtvLwtIRwKMRMv3UsqVXhwP0Qn79yda wnYg== X-Gm-Message-State: APjAAAXJY8BszYE9cBDDt3i8q2m5Pbmoj7eksEJpXZfWNnm7rIk5X4wj VfQz+IpRNh6vBgtMDgXm01saOZG2ZnY= X-Google-Smtp-Source: APXvYqz3mBMiDGFjNTjc11Zx+ZqWkIoqVKj1afWLePMbJ/izkRMkgCDLpCPDZcI3iKdKSfTa+ynj9Q== X-Received: by 2002:a1c:9e4c:: with SMTP id h73mr134022wme.177.1578418756742; Tue, 07 Jan 2020 09:39:16 -0800 (PST) Received: from localhost.localdomain (38.163.200.146.dyn.plus.net. [146.200.163.38]) by smtp.gmail.com with ESMTPSA id u18sm648235wrt.26.2020.01.07.09.39.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jan 2020 09:39:16 -0800 (PST) From: Wei Liu X-Google-Original-From: Wei Liu To: Xen Development List Date: Tue, 7 Jan 2020 17:39:01 +0000 Message-Id: <20200107173902.13768-2-liuwe@microsoft.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200107173902.13768-1-liuwe@microsoft.com> References: <20200107173902.13768-1-liuwe@microsoft.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 1/2] x86/hyperv: drop usage of GENMASK_ULL from hyperv-tlfs.h X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Wei Liu , Wei Liu , Paul Durrant , Andrew Cooper , Michael Kelley , Jan Beulich , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" I'm told that GENMASK_ULL shouldn't be used outside of Arm code in its current form. Requested-by: Jan Beulich Signed-off-by: Wei Liu Acked-by: Jan Beulich --- xen/include/asm-x86/guest/hyperv-tlfs.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xen/include/asm-x86/guest/hyperv-tlfs.h b/xen/include/asm-x86/guest/hyperv-tlfs.h index 5b43f99de8..e4183c802c 100644 --- a/xen/include/asm-x86/guest/hyperv-tlfs.h +++ b/xen/include/asm-x86/guest/hyperv-tlfs.h @@ -415,13 +415,13 @@ enum HV_GENERIC_SET_FORMAT { HV_GENERIC_SET_ALL, }; -#define HV_HYPERCALL_RESULT_MASK GENMASK_ULL(15, 0) +#define HV_HYPERCALL_RESULT_MASK 0xffff /* GENMASK_ULL(15, 0) */ #define HV_HYPERCALL_FAST_BIT BIT(16, UL) #define HV_HYPERCALL_VARHEAD_OFFSET 17 #define HV_HYPERCALL_REP_COMP_OFFSET 32 -#define HV_HYPERCALL_REP_COMP_MASK GENMASK_ULL(43, 32) +#define HV_HYPERCALL_REP_COMP_MASK 0xfff00000000 /* GENMASK_ULL(43, 32) */ #define HV_HYPERCALL_REP_START_OFFSET 48 -#define HV_HYPERCALL_REP_START_MASK GENMASK_ULL(59, 48) +#define HV_HYPERCALL_REP_START_MASK 0xfff000000000000 /* GENMASK_ULL(59, 48) */ /* hypercall status code */ #define HV_STATUS_SUCCESS 0 From patchwork Tue Jan 7 17:39:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 11321511 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C6B991398 for ; Tue, 7 Jan 2020 17:40:22 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A1E2A20848 for ; Tue, 7 Jan 2020 17:40:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="uug6HvmB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A1E2A20848 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xen.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iospE-0004e5-Nv; Tue, 07 Jan 2020 17:39:28 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iospD-0004dc-8m for xen-devel@lists.xenproject.org; Tue, 07 Jan 2020 17:39:27 +0000 X-Inumbo-ID: a15a2746-3174-11ea-b836-bc764e2007e4 Received: from mail-wm1-x343.google.com (unknown [2a00:1450:4864:20::343]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id a15a2746-3174-11ea-b836-bc764e2007e4; Tue, 07 Jan 2020 17:39:18 +0000 (UTC) Received: by mail-wm1-x343.google.com with SMTP id u2so437169wmc.3 for ; Tue, 07 Jan 2020 09:39:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fhOwbwa9USlRJsIPtxOUHn3Qkv+pT5If6Tbtf2TMXAk=; b=uug6HvmBk3f8/UhDN0B/4860QyD1v20VqIChbEauQR2kJu2W8NsscVmsLxEwb7KIJ1 gaBFPGH/hWAJ2NfGd1Az0zb2ojsOCzCflGulYJBpTmF/QAsH6z2SIDcUyzKvRi9ZWW88 biCJIzCz6Cc4hv6pLTSo4R+4LWmCj1YD4Lv5pShIzFhIXINRYowdJEqVkArnM4Fzg9UL 3H9wdScqjUrycdK7st3MFPx0R6IV/+PjptkIVzuO1UsUGDVHwF9ImkL+0g44a+qn4xqY IrSZjIP83u5Zp0NQyHR07G1rmmnPjmCDaYlyFDLUBKKkLncnxI12/TR8krqc0L61Exci UVOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=fhOwbwa9USlRJsIPtxOUHn3Qkv+pT5If6Tbtf2TMXAk=; b=j4HbxUmnoPAPl5pUbJrrAnlBJsv8Ua6vOKbV93dczjCsewEJNrXEZJqiTmZN/4S3l0 fYtq0OzzLS3NDxiCrrfqaJ5ENY0YEYR1xBEzLMJDw3YMkOSnJI6kWKSDU8seRiuppXR9 BApRNQfwRRLBFEvEut6SMLAGTteV3ob7iZCw5Ur0pSME9E5cYaVccHI6DJCH981Hdi7b 9T7fjpj77XColEBwVGFB3jDzd3kJq5DqTJSrmeND/pK1d9V2zky8hrgzmJlq9Peac1m9 wXG2RvyXJe1XXz91KMKJH9EXgT0i92w0twwssWVjU9k1vfp9GybyCEtBqL8IeTg0foCa thjA== X-Gm-Message-State: APjAAAUlnC0B5HublgI4hw1MOcoJAUZ2ky9AA51/YSb+NyRQYDUdJc89 /PkitPArXP6yfdFND5U+qeAjMWg2B9Q= X-Google-Smtp-Source: APXvYqydUUNePcN4lnXnXk4I734EDhXvAJzsbAQCLpiZbxvpXhYfegs/LbNS1ksvS9qyPaBn4mXJew== X-Received: by 2002:a1c:4d03:: with SMTP id o3mr191110wmh.164.1578418757565; Tue, 07 Jan 2020 09:39:17 -0800 (PST) Received: from localhost.localdomain (38.163.200.146.dyn.plus.net. [146.200.163.38]) by smtp.gmail.com with ESMTPSA id u18sm648235wrt.26.2020.01.07.09.39.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jan 2020 09:39:17 -0800 (PST) From: Wei Liu X-Google-Original-From: Wei Liu To: Xen Development List Date: Tue, 7 Jan 2020 17:39:02 +0000 Message-Id: <20200107173902.13768-3-liuwe@microsoft.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200107173902.13768-1-liuwe@microsoft.com> References: <20200107173902.13768-1-liuwe@microsoft.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH 2/2] x86/hyperv: drop all __packed from hyperv-tlfs.h X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Wei Liu , Wei Liu , Paul Durrant , Andrew Cooper , Michael Kelley , Jan Beulich , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" All structures are already naturally aligned. Linux added those attributes out of paranoia. In Xen we've had instance we had to drop pointless __packed to placate gcc 9 (see ca9310b24e), it is better drop those attributes. Requested-by: Jan Beulich Signed-off-by: Wei Liu Acked-by: Jan Beulich --- xen/include/asm-x86/guest/hyperv-tlfs.h | 54 ++++++++++++------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/xen/include/asm-x86/guest/hyperv-tlfs.h b/xen/include/asm-x86/guest/hyperv-tlfs.h index e4183c802c..0811785002 100644 --- a/xen/include/asm-x86/guest/hyperv-tlfs.h +++ b/xen/include/asm-x86/guest/hyperv-tlfs.h @@ -288,7 +288,7 @@ union hv_x64_msr_hypercall_contents { u64 enable:1; u64 reserved:11; u64 guest_physical_address:52; - } __packed; + }; }; /* @@ -300,7 +300,7 @@ struct ms_hyperv_tsc_page { volatile u64 tsc_scale; volatile s64 tsc_offset; u64 reserved2[509]; -} __packed; +}; /* * The guest OS needs to register the guest ID with the hypervisor. @@ -347,17 +347,17 @@ struct hv_reenlightenment_control { __u64 enabled:1; __u64 reserved2:15; __u64 target_vp:32; -} __packed; +}; struct hv_tsc_emulation_control { __u64 enabled:1; __u64 reserved:63; -} __packed; +}; struct hv_tsc_emulation_status { __u64 inprogress:1; __u64 reserved:63; -} __packed; +}; #define HV_X64_MSR_HYPERCALL_ENABLE 0x00000001 #define HV_X64_MSR_HYPERCALL_PAGE_ADDRESS_SHIFT 12 @@ -445,7 +445,7 @@ typedef struct _HV_REFERENCE_TSC_PAGE { __u32 res1; __u64 tsc_scale; __s64 tsc_offset; -} __packed HV_REFERENCE_TSC_PAGE, *PHV_REFERENCE_TSC_PAGE; +} HV_REFERENCE_TSC_PAGE, *PHV_REFERENCE_TSC_PAGE; /* Define the number of synthetic interrupt sources. */ #define HV_SYNIC_SINT_COUNT (16) @@ -502,7 +502,7 @@ union hv_message_flags { struct { __u8 msg_pending:1; __u8 reserved:7; - } __packed; + }; }; /* Define port identifier type. */ @@ -511,7 +511,7 @@ union hv_port_id { struct { __u32 id:24; __u32 reserved:8; - } __packed u; + } u; }; /* Define synthetic interrupt controller message header. */ @@ -524,7 +524,7 @@ struct hv_message_header { __u64 sender; union hv_port_id port; }; -} __packed; +}; /* Define synthetic interrupt controller message format. */ struct hv_message { @@ -532,12 +532,12 @@ struct hv_message { union { __u64 payload[HV_MESSAGE_PAYLOAD_QWORD_COUNT]; } u; -} __packed; +}; /* Define the synthetic interrupt message page layout. */ struct hv_message_page { struct hv_message sint_message[HV_SYNIC_SINT_COUNT]; -} __packed; +}; /* Define timer message payload structure. */ struct hv_timer_message_payload { @@ -545,7 +545,7 @@ struct hv_timer_message_payload { __u32 reserved; __u64 expiration_time; /* When the timer expired */ __u64 delivery_time; /* When the message was delivered */ -} __packed; +}; struct hv_nested_enlightenments_control { struct { @@ -555,7 +555,7 @@ struct hv_nested_enlightenments_control { struct { __u32 reserved; } hypercallControls; -} __packed; +}; /* Define virtual processor assist page structure. */ struct hv_vp_assist_page { @@ -566,7 +566,7 @@ struct hv_vp_assist_page { __u8 enlighten_vmentry; __u8 reserved2[7]; __u64 current_nested_vmcs; -} __packed; +}; struct hv_enlightened_vmcs { u32 revision_id; @@ -742,7 +742,7 @@ struct hv_enlightened_vmcs { u32 nested_flush_hypercall:1; u32 msr_bitmap:1; u32 reserved:30; - } __packed hv_enlightenments_control; + } hv_enlightenments_control; u32 hv_vp_id; u64 hv_vm_id; @@ -752,7 +752,7 @@ struct hv_enlightened_vmcs { u64 padding64_5[7]; u64 xss_exit_bitmap; u64 padding64_6[7]; -} __packed; +}; #define HV_VMX_ENLIGHTENED_CLEAN_FIELD_NONE 0 #define HV_VMX_ENLIGHTENED_CLEAN_FIELD_IO_BITMAP BIT(0, UL) @@ -793,7 +793,7 @@ union hv_stimer_config { u64 reserved_z0:3; u64 sintx:4; u64 reserved_z1:44; - } __packed; + }; }; @@ -808,7 +808,7 @@ union hv_synic_scontrol { struct { u64 enable:1; u64 reserved:63; - } __packed; + }; }; /* Define synthetic interrupt source. */ @@ -821,7 +821,7 @@ union hv_synic_sint { u64 auto_eoi:1; u64 polling:1; u64 reserved2:45; - } __packed; + }; }; /* Define the format of the SIMP register */ @@ -831,7 +831,7 @@ union hv_synic_simp { u64 simp_enabled:1; u64 preserved:11; u64 base_simp_gpa:52; - } __packed; + }; }; /* Define the format of the SIEFP register */ @@ -841,34 +841,34 @@ union hv_synic_siefp { u64 siefp_enabled:1; u64 preserved:11; u64 base_siefp_gpa:52; - } __packed; + }; }; struct hv_vpset { u64 format; u64 valid_bank_mask; u64 bank_contents[]; -} __packed; +}; /* HvCallSendSyntheticClusterIpi hypercall */ struct hv_send_ipi { u32 vector; u32 reserved; u64 cpu_mask; -} __packed; +}; /* HvCallSendSyntheticClusterIpiEx hypercall */ struct hv_send_ipi_ex { u32 vector; u32 reserved; struct hv_vpset vp_set; -} __packed; +}; /* HvFlushGuestPhysicalAddressSpace hypercalls */ struct hv_guest_mapping_flush { u64 address_space; u64 flags; -} __packed; +}; /* * HV_MAX_FLUSH_PAGES = "additional_pages" + 1. It's limited @@ -906,7 +906,7 @@ struct hv_tlb_flush { u64 flags; u64 processor_mask; u64 gva_list[]; -} __packed; +}; /* HvFlushVirtualAddressSpaceEx hypercall */ struct hv_tlb_flush_ex { @@ -914,7 +914,7 @@ struct hv_tlb_flush_ex { u64 flags; struct hv_vpset hv_vp_set; /* u64 gva_list[]; */ -} __packed; +}; struct hv_partition_assist_pg { u32 tlb_lock_count;