From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (NAM12-BN8-obe.outbound.protection.outlook.com [40.107.237.67]) by mx.groups.io with SMTP id smtpd.web09.529.1604684916797648592 for ; Fri, 06 Nov 2020 09:48:37 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector2-amdcloud-onmicrosoft-com header.b=zTumudHx; spf=none, err=SPF record not found (domain: amd.com, ip: 40.107.237.67, mailfrom: thomas.lendacky@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PzGCxVO64jCVA/8cZ8fI5ebLNMUkGf7CepFdHwzdVlzE1gO8ya6TUYvua4I4Xhh8FcKdIKbEAObcEty9yf1Fzgm7ILlzyeVQ/S2ZJBpn4ffaQfGZJ7VdFMfBw46O3+j5V3tt9im4V3LbvrCqUa0yP47m26h2drLGhInTqrGQ+CW3tj4qR16Zd+FGh/zh5aOBT7OIZHPBRYZ/0UbVeyF9LCXM/PrgezzvvftM/EjUWoHOea8nKh4A62rTccgDYniBYrdDuINEMK8AikpU7A5y9ii5U1PjafYuEkq+7Fwtj0aaYxli31DCc/1Cch1MX5/qzXG36wnRZDGGjEq985yvUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=p3F2PFzPur4k+ekIPaLfHFTw38LHIntvHNHxRwtH0x8=; b=GfhRkr1SMJjP+croS5tj7/AAYDBw5FqCmuaeYUwfnbvUp+GariD7JMy3SL9uWWRAVPyDqEAcodijPUiSvCJuQ1tNEvwYNcpXmVKxChQAgDQyeiM623p8XUuWt7bN4Xp0Gcuf6wfbsofi1ZCP3riVv8uKfFr9OVTD2MVrwIrc+xP2sAjiJTwMvEDvjlZgQBKygOeDe3QMRfEpHG7Qrz4SilWN4eMX3lsm6cG4xEKuoWxu/b4dBsiMcJx6ufApHdHCEEvOAQtQoi3VavjACr66grsk2zKPa56uYtO1eUUMxoARCKGAqvd+IikjjasFcbyNhLVZb7PkXg42scFR81F4jA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=p3F2PFzPur4k+ekIPaLfHFTw38LHIntvHNHxRwtH0x8=; b=zTumudHxVUlV/8kwmejknKHVg9biZfw90hyjlQcIp1vRh1ReTvOROzR73EnPzX4kSVWVwYSIvJrRXZvF0iu2mpuIza0evPHUQP+oEFtayDD1bimrk7yByMOxu1B/D6ZDKUYGAPJr/hr+1XwDBzNpJJIHKs3ND3gPwe4XMI1QZFw= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=amd.com; Received: from DM5PR12MB1355.namprd12.prod.outlook.com (2603:10b6:3:6e::7) by DM6PR12MB4385.namprd12.prod.outlook.com (2603:10b6:5:2a6::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3541.21; Fri, 6 Nov 2020 17:48:34 +0000 Received: from DM5PR12MB1355.namprd12.prod.outlook.com ([fe80::e442:c052:8a2c:5fba]) by DM5PR12MB1355.namprd12.prod.outlook.com ([fe80::e442:c052:8a2c:5fba%6]) with mapi id 15.20.3499.032; Fri, 6 Nov 2020 17:48:34 +0000 Subject: Re: [edk2-devel] [PATCH v3 00/11] SEV-ES guest support fixes and cleanup To: Laszlo Ersek , devel@edk2.groups.io Cc: Brijesh Singh , Ard Biesheuvel , Eric Dong , Liming Gao , Jordan Justen , Michael D Kinney , Rahul Kumar , Zhiguang Liu , Ray Ni References: <41dd8877-4954-e32d-0398-b4f0525bc2de@redhat.com> <1ab7c714-4921-b85b-23ab-7060f6c1ff59@amd.com> From: "Lendacky, Thomas" Message-ID: Date: Fri, 6 Nov 2020 11:48:32 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 In-Reply-To: X-Originating-IP: [67.79.209.213] X-ClientProxiedBy: SN4PR0501CA0015.namprd05.prod.outlook.com (2603:10b6:803:40::28) To DM5PR12MB1355.namprd12.prod.outlook.com (2603:10b6:3:6e::7) Return-Path: thomas.lendacky@amd.com MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from office-linux.texastahm.com (67.79.209.213) by SN4PR0501CA0015.namprd05.prod.outlook.com (2603:10b6:803:40::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3541.10 via Frontend Transport; Fri, 6 Nov 2020 17:48:33 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: d49e2565-478a-4279-54b0-08d8827c2ed3 X-MS-TrafficTypeDiagnostic: DM6PR12MB4385: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2399; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vicgP3d6f8zsw6eaUUnEb+BM/jkOOYcC4P9DUnjrGNhPxqglsysUjZAJuX7F0Ahau4Q/QEhWtsTfhiyKXYRIgKTqPl1cDgf51Pm4oZRYceNXRwRhrK80LIZVkNsTuRdp5uOoXlkPr+JAA2MbqnTT/eaxhdP4Dh6hVcuqvPLnNN8XdqnY9+TeR0vGSjgol35K/z1X66cyDpsY8lFCouesjFirZZu12pr2I6L2KNUqYmYY8tdn6rlSgYXI6VGEp+S9Bc5WPCl5QCVYQYahCLV9zFm5oWpLugHa6jLb36yIHhA6CE+iRX7JAyTvRgMYCRvoSrs/P+yWdeIlPUaO50wb2jUviiniOOc56IPtdz/v+fPUz4LKJPnO7CWWoabnrgz/ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR12MB1355.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(376002)(136003)(346002)(396003)(39860400002)(316002)(86362001)(83380400001)(52116002)(31696002)(66946007)(5660300002)(8936002)(36756003)(7416002)(31686004)(8676002)(478600001)(6506007)(66476007)(16526019)(53546011)(26005)(2906002)(186003)(66556008)(6486002)(6512007)(4326008)(54906003)(956004)(2616005)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: Nrl/n6I7B/ZndsWuPggYVKm57guEoueHkO8XTb7g+eFHtPlGCv7VZjDKWmjEc9o3JxWxIWz1FrTMUkOzvC1uni1TPNSLMm4GERLZAc504xNhwufgsvIsj7heySJgwZrH7Dhuvc8viqwSZBekXG2PmfCVukOKGXOvvKTOQeaI0L0R/KpMxPkf6wDcw+TFThePS6XD+DGxCHS5Xyu0BGu6RgbWW26F3AP3mKqg8u264FxQVmAKSRA0qp0D/yWhMhL61o2chMCB6atW0714mS3xebM7k7/tWTm8rw4F6DkCK4J7mES9LDZoLXKQDtzXlijInD688OrWdjg7Rz/jNr8kQBI/tGxB451s79YexZwOE3IYePqPoTwOm64rE7O3hNO5UJ1PmWnivQL/Uqtg3yUXn2577752s70RPx/MrxT6YUdA3quQfLm7wmGSb56h6jztnxLVSCiQ1xxsIVBdIDCDwzWDtg+xsGCQB7OOEbj8oDhg1mSWnsrK4GffiQD5Goxx3t4+Ev1iQtOWBjxMn2bdkGuV9a3hGtG7HfLb8GeWL36cpXhTtpB/b19IZyxksgZehjBONKWVVOAsD/FgseV14G1DXpreATmQPUvXheIttTvyYuMzJBUpfhZ7tBf17Byxp8SoURCGsC5pUTUd4KnpCg== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: d49e2565-478a-4279-54b0-08d8827c2ed3 X-MS-Exchange-CrossTenant-AuthSource: DM5PR12MB1355.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Nov 2020 17:48:34.7991 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: yjHoh4CvGjJShuvq4QMwFrt/6WGJe+ddkQVMAyJvD68YxzuqSq2CMK/721WR3gbn9uPewsmRA8sIsIPJ132Kkw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4385 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit On 11/6/20 10:46 AM, Laszlo Ersek wrote: > On 11/06/20 07:29, Tom Lendacky wrote: >> On 11/5/20 8:34 AM, Tom Lendacky wrote: >>> On 11/4/20 9:29 PM, Laszlo Ersek wrote: > >>>> I've submitted PR#1086 [...] but CI seems slower than usual today, >>>> and I really need some sleep, so I won't wait for CI. Tom, if the PR >>>> succeeds, please close TianoCore#3008, noting the commit range, and >>>> please also follow up in this thread with the commit range. >>> >>> Thanks, Laszlo! >>> >>> It looks like it failed because it doesn't like the use of the >>> "sizeof (UINT64)". I suppose I can change that to just hard code a >>> value of 8. Let me know what you think. >> >> I did verify that changing the "sizeof (UINT64)" to "8" in the first >> patch results in all CI tests passing. I can re-submit with that, if >> you feel that is the best course of action. > > > So this is the error (from ECC), if I understand correctly: > >> 2020-11-05T03:25:05.2175761Z ERROR - EFI coding style error >> 2020-11-05T03:25:05.2176262Z ERROR - *Error code: 8005 >> 2020-11-05T03:25:05.2177026Z ERROR - *Variable name does not follow the rules: 1. First character should be upper case 2. Must contain lower case characters 3. No white space characters 4. Global variable name must start with a 'g' >> 2020-11-05T03:25:05.2177773Z ERROR - *file: //home/vsts/work/1/s/MdePkg/Include/Register/Amd/Ghcb.h >> 2020-11-05T03:25:05.2180810Z ERROR - *Line number: 114 >> 2020-11-05T03:25:05.2181426Z ERROR - *Member variable [GHCB_REGISTER.(UINT64)] NOT follow naming convention. > > for such lines as: > >> GhcbCpl = OFFSET_OF (GHCB, SaveArea.Cpl) / sizeof (UINT64), > > I think this is a bug in CheckMemberVariableFormat(), in > "BaseTools/Source/Python/Ecc/c.py". > > I don't exactly understand how that ECC method functions. However, > squashing the following update into the first (MdePkg) patch of this > series seems to work: > >> diff --git a/MdePkg/Include/Register/Amd/Ghcb.h b/MdePkg/Include/Register/Amd/Ghcb.h >> index 1fce64d5b7cd..3814a79e0619 100644 >> --- a/MdePkg/Include/Register/Amd/Ghcb.h >> +++ b/MdePkg/Include/Register/Amd/Ghcb.h >> @@ -111,17 +111,20 @@ typedef PACKED struct { >> UINT32 GhcbUsage; >> } GHCB; >> >> +#define GHCB_SAVE_AREA_WORD_OFFSET(RegisterField) \ I'll make one minor change here, s/WORD/QWORD/. >> + (OFFSET_OF (GHCB, SaveArea.RegisterField) / sizeof (UINT64)) >> + >> typedef enum { >> - GhcbCpl = OFFSET_OF (GHCB, SaveArea.Cpl) / sizeof (UINT64), >> - GhcbRax = OFFSET_OF (GHCB, SaveArea.Rax) / sizeof (UINT64), >> - GhcbRbx = OFFSET_OF (GHCB, SaveArea.Rbx) / sizeof (UINT64), >> - GhcbRcx = OFFSET_OF (GHCB, SaveArea.Rcx) / sizeof (UINT64), >> - GhcbRdx = OFFSET_OF (GHCB, SaveArea.Rdx) / sizeof (UINT64), >> - GhcbXCr0 = OFFSET_OF (GHCB, SaveArea.XCr0) / sizeof (UINT64), >> - GhcbSwExitCode = OFFSET_OF (GHCB, SaveArea.SwExitCode) / sizeof (UINT64), >> - GhcbSwExitInfo1 = OFFSET_OF (GHCB, SaveArea.SwExitInfo1) / sizeof (UINT64), >> - GhcbSwExitInfo2 = OFFSET_OF (GHCB, SaveArea.SwExitInfo2) / sizeof (UINT64), >> - GhcbSwScratch = OFFSET_OF (GHCB, SaveArea.SwScratch) / sizeof (UINT64), >> + GhcbCpl = GHCB_SAVE_AREA_WORD_OFFSET (Cpl), >> + GhcbRax = GHCB_SAVE_AREA_WORD_OFFSET (Rax), >> + GhcbRbx = GHCB_SAVE_AREA_WORD_OFFSET (Rbx), >> + GhcbRcx = GHCB_SAVE_AREA_WORD_OFFSET (Rcx), >> + GhcbRdx = GHCB_SAVE_AREA_WORD_OFFSET (Rdx), >> + GhcbXCr0 = GHCB_SAVE_AREA_WORD_OFFSET (XCr0), >> + GhcbSwExitCode = GHCB_SAVE_AREA_WORD_OFFSET (SwExitCode), >> + GhcbSwExitInfo1 = GHCB_SAVE_AREA_WORD_OFFSET (SwExitInfo1), >> + GhcbSwExitInfo2 = GHCB_SAVE_AREA_WORD_OFFSET (SwExitInfo2), >> + GhcbSwScratch = GHCB_SAVE_AREA_WORD_OFFSET (SwScratch), >> } GHCB_REGISTER; >> >> typedef union { > > I build-tested this update with gcc, and also verified that it passes > ECC, by running CI locally. (I reproduced the bogus ECC error message > locally at first, of course, to see if the update makes a difference.) > >> PROGRESS - --Running MdePkg: EccCheck Test NO-TARGET -- >> PROGRESS - --->Test Success: EccCheck Test NO-TARGET > > If it works for you as well (check with a personal build PR perhaps), Yup, that works, all tests passed. > then I suggest posting v4 -- Liming should please re-check the udpated > MdePkg patch, and then we can merge the series. Ok, I'll submit a v4 and without Liming's Reviewed-by on the first patch. Thanks, Tom > > Thanks! > Laszlo >