From nobody Mon Nov 25 07:47:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1717443480; cv=pass; d=zohomail.com; s=zohoarc; b=ivUsRAZCb8TLhvVj6euVvGm7wk1o8KzSNoYaO5myIog8fykDV3/eV5DPWXOlnVgGiMdmENXfu95jhh3THFUH2qHvCIOfpf2e5XKi6PoufWylMgEEqmta5KuWDbgMTOibNRrr2bcFxIu5ESud+ZIIHPtS8bzSOqoVnr9n57Tx6g0= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1717443480; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=/4Hbi3YIubbuokjUvp7e7NkkTWrJLvoNA8UYFbv/640=; b=Qigs5GS+isL6QgEwEny5C1rY5UfsGsitITtT7hJUIFKqad4Mgoa2Sa1WQbtzc/n/LdRJv94h/5yinXziOhU3qKzpRJHh9nLFk8gqPZeNgjhoaNjf2y7aQt0Ff9PvkRuDa7ydH6D5Zj6Q96eySxFeRhGpplfQSCrgChv731D2JWg= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17174434799661002.0309152260074; Mon, 3 Jun 2024 12:37:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEDUQ-00043E-3H; Mon, 03 Jun 2024 15:37:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sEDUO-000435-L9 for qemu-devel@nongnu.org; Mon, 03 Jun 2024 15:37:04 -0400 Received: from mail-dm3nam02on20600.outbound.protection.outlook.com ([2a01:111:f403:2405::600] helo=NAM02-DM3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sEDUM-0003Ge-Ll for qemu-devel@nongnu.org; Mon, 03 Jun 2024 15:37:04 -0400 Received: from CH2PR16CA0005.namprd16.prod.outlook.com (2603:10b6:610:50::15) by SA3PR12MB7923.namprd12.prod.outlook.com (2603:10b6:806:317::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.27; Mon, 3 Jun 2024 19:36:58 +0000 Received: from CH1PEPF0000A347.namprd04.prod.outlook.com (2603:10b6:610:50:cafe::27) by CH2PR16CA0005.outlook.office365.com (2603:10b6:610:50::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.30 via Frontend Transport; Mon, 3 Jun 2024 19:36:57 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by CH1PEPF0000A347.mail.protection.outlook.com (10.167.244.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7633.15 via Frontend Transport; Mon, 3 Jun 2024 19:36:57 +0000 Received: from jallen-jump-host.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 3 Jun 2024 14:36:56 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MZCQY92CxH8rHcdjksmid3/tvlKzBZop6PabvHbgaVPdkp1p/26mwCqEEkmX3vU6oVkhO8yuCUbFSrlA67qLrN5maYjtvz6Ct71hwHdhx2oIWJrSUv+frntVz9IWSeNokHE7O/m9lj7fMRqbd/PHZ8eD59IfjZEWG6t60/dLCRo3ZLOG45wGMw6DrWkMAd+EIzNXvFiy4TPgCxiA/uXSibby3/xfqcp5pDthDJlB47nCU4GBNijm7oe1qThoI1YzH2LzKluoYZQg+02lvJ/bd5pjdsKTq3DS+fl6droelquw9woAu/8YOYKGetMJnxULSh9NQxlT4U91fgdJFlY+dg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/4Hbi3YIubbuokjUvp7e7NkkTWrJLvoNA8UYFbv/640=; b=L1DJpBfhSktV/KUnrNW6YTosuWJ91XRjjonEF89kAEdA37HDWrfrH3le56IVzR1HIyu9CQOBE4t5wrvgbKVPWsusr4sXY5im0qe/6fjekW6m39fgY8RnuLi7NWz8IzYY7NlRSILJP/cWW//oPlHiLOGAIgPaH9+gwF9+eXkjJJnjzOkrCcqpSYME9sFpzaFymjXMVQOa9mLX+oZ2CHti8xyallZMymWqLEPSDeY9YJPUEpi6dII7YugDa2pQftSRYLuBoieei/SvJRBiATlNxLSPPqRfNqR3gxfMk05TtX4ZMdKhGLxyEpq3Q4lI40Uwo3lF2UxM+jrqXKSm61pWVA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=nongnu.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/4Hbi3YIubbuokjUvp7e7NkkTWrJLvoNA8UYFbv/640=; b=JKn+lnbFMNs9bTmY6JRIeRqYmvCC6pyKaC+0d4QmBPdet+3OQND4V5juCNgNVlL1bG3hNdu/H+q9R9ZG+7ACCSogmxSVGuW1onnHR8TIXt2vsBDbiX59ZZSG17lizpSnMIIEp20iNN761nAQmCAVkcRc2cv5k4QMIHTKmjJPgvU= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C From: John Allen To: CC: , , , , , , , , , John Allen Subject: [PATCH v5 3/3] i386: Add support for overflow recovery Date: Mon, 3 Jun 2024 19:36:22 +0000 Message-ID: <20240603193622.47156-4-john.allen@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240603193622.47156-1-john.allen@amd.com> References: <20240603193622.47156-1-john.allen@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH1PEPF0000A347:EE_|SA3PR12MB7923:EE_ X-MS-Office365-Filtering-Correlation-Id: a2c53cd8-0e19-4187-301d-08dc8404880c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|36860700004|376005|82310400017|1800799015; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?WIayh/4YaeJBpIgyf+XbFVkpp2j+znunVDaK9k9gmCsDZKyYwfSKzyWROaG8?= =?us-ascii?Q?752ssc9qEYxQ0tQl2SXjpVc8nNCkNIQ0dofJltLKUCdBFBMQguMKH9C24dYM?= =?us-ascii?Q?YLjTB02m6Oc77ssRrMNdsukC4eLPTJvs1iYgZdT4DyhQ3oyIqCVIbMcUHEjh?= =?us-ascii?Q?8DXBcdKc0jqiv1xB9RqU1tid7jGfvDRM3bIwqoXY22tNxXn9QjgyktglhLwx?= =?us-ascii?Q?LE4V/kNR2Wt1cOaR1/K04aQOm51rYJL7fp59bil1lL6MPhc2+NdC5/XLNBI+?= =?us-ascii?Q?z7mKvQ7Ka0vAQEaydWOuY94F97B0f17POydW65dkM7Pm/EVmpniJHX4+yETc?= =?us-ascii?Q?u3rPDjZCQ6uCleoWfcPHL1rN59+bPKhxm3Vf3noAbk6KshUWXOISPFKEp+Bs?= =?us-ascii?Q?TxI9DMqenHhaR6Mo5ndWtUYEG7Vze82PQei9g+r9X5h/de3I9jTWxaIgM90B?= =?us-ascii?Q?JsUGsDg0DMUl9w9yHc4cVVjEW6mMdiwNRv9cqdcfVxn8Oz/XKBlwWSoMN4cG?= =?us-ascii?Q?7Tlf2M0WtIrFX1UaH9rsTKeFgD3WsHS3cxER5f5ekEIQKYc4GV0Qw7XpZqUz?= =?us-ascii?Q?fJn3JzXp4BTLkQIhbM4Ot5p7lamVAoBH5vqBXAG5ICY0ISJ6rcRjHedm1/IN?= =?us-ascii?Q?Qb8CdJ/G6q0VKQVCgETgEl7lIr6EBBPNmdSYoLVCLe1fUtJNcP/rtVKtLNYd?= =?us-ascii?Q?vvlLdAQOALE9jGSodZ+yjBHhi4AdRwCDoorBTEni7oGbj8fZQpIxYpWTKQ7v?= =?us-ascii?Q?fSKBVpdtY+ZANcj2nfPq8MzCVAVKGYE0F6o/+EmiI0tGqgIB869UGCrvukTY?= =?us-ascii?Q?+BVbfylIw9eOY1UxnclZNfiwAsIkUV4vGp75GnPijLXzgzCAjR83bhhcZPL9?= =?us-ascii?Q?Dp6Lpy2phutp3eFpnm87uZE5JiuKF1ZC+7n7MXwlMDC8eoRyT+78QSTShguz?= =?us-ascii?Q?4soI3ahLA05E8nw4TOxivgmhZ/mlkrCm6Tkm98u/KDOkCypxL9Yfid4e7/am?= =?us-ascii?Q?3CdORDwo6sA6wwnTY+cKoTv3u81q0rqIaxNTo6KErc38zE3qSMlVLe9ng1jg?= =?us-ascii?Q?jjVBKQG+OxOkLKqiA07kcQaMbzy6qVD3AmfrA6CDwlW9xAtkztumxeC3AhTg?= =?us-ascii?Q?ula3t1zuFw6/kmb4GpW9DNhCQAGEZFTQdIifGKiNeP6ucmq+7uo+14D5F2Js?= =?us-ascii?Q?qXArrqNSNagbFYa3SkjzdPwM8pEIV+It+0zWxYwI5R2P5BTxBLJlIEnj/+Gc?= =?us-ascii?Q?yhhfmX8xR0SJm1fQqknwJQqB54LU+LslFT+gnAUHtqzQUSqJFW0TvqZTt5N6?= =?us-ascii?Q?LfmCdx6HqNzcVg/v78Aq4619aeLVzJX6nY4Ymw5E+SHm/N9yNzQMBOk2YtCH?= =?us-ascii?Q?kHAbwychmsNqkjtbC7d2OPOZErhAMe3M0jRCL/GzOIm9wd7ynA=3D=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(36860700004)(376005)(82310400017)(1800799015); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jun 2024 19:36:57.6378 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a2c53cd8-0e19-4187-301d-08dc8404880c X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CH1PEPF0000A347.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB7923 Received-SPF: permerror client-ip=2a01:111:f403:2405::600; envelope-from=John.Allen@amd.com; helo=NAM02-DM3-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1717443481500100001 Content-Type: text/plain; charset="utf-8" Add cpuid bit definition for overflow recovery. This is needed in the case where a deferred error has been sent to the guest, a guest process accesses= the poisoned memory, but the machine_check_poll function has not yet handled the original deferred error. If overflow recovery is not set in this case, when= we handle the uncorrected error from the poisoned memory access, the overflow = bit will be set and will result in the guest being shut down. Signed-off-by: John Allen --- v5: - New in v5. --- target/i386/cpu.c | 2 +- target/i386/cpu.h | 1 + target/i386/kvm/kvm.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 5fa2dde732..5385b26d4a 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -1035,7 +1035,7 @@ FeatureWordInfo feature_word_info[FEATURE_WORDS] =3D { [FEAT_8000_0007_EBX] =3D { .type =3D CPUID_FEATURE_WORD, .feat_names =3D { - NULL, "succor", NULL, NULL, + "overflow-recov", "succor", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 5dd41e3d69..d56cf631b5 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -955,6 +955,7 @@ uint64_t x86_cpu_get_supported_feature_word(FeatureWord= w, #define CPUID_14_0_ECX_LIP (1U << 31) =20 /* RAS Features */ +#define CPUID_8000_0007_EBX_OVERFLOW_RECOV (1U << 0) #define CPUID_8000_0007_EBX_SUCCOR (1U << 1) =20 /* CLZERO instruction */ diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index 384b702fef..796d5e9e38 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -477,7 +477,7 @@ uint32_t kvm_arch_get_supported_cpuid(KVMState *s, uint= 32_t function, cpuid_1_edx =3D kvm_arch_get_supported_cpuid(s, 1, 0, R_EDX); ret |=3D cpuid_1_edx & CPUID_EXT2_AMD_ALIASES; } else if (function =3D=3D 0x80000007 && reg =3D=3D R_EBX) { - ret |=3D CPUID_8000_0007_EBX_SUCCOR; + ret |=3D CPUID_8000_0007_EBX_OVERFLOW_RECOV | CPUID_8000_0007_EBX_= SUCCOR; } else if (function =3D=3D KVM_CPUID_FEATURES && reg =3D=3D R_EAX) { /* kvm_pv_unhalt is reported by GET_SUPPORTED_CPUID, but it can't * be enabled without the in-kernel irqchip --=20 2.43.0