From patchwork Tue Jan 23 06:42:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: liuhongt X-Patchwork-Id: 190752 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2553:b0:103:945f:af90 with SMTP id p19csp156151dyi; Mon, 22 Jan 2024 22:45:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IG7BGP3l+M/CKdPgFMewvwMpEy0jojEyz4xFaobCvl26ryYWDuj+SERk/Y39rAF+I5huYoM X-Received: by 2002:ac8:7d04:0:b0:42a:4a6d:8b00 with SMTP id g4-20020ac87d04000000b0042a4a6d8b00mr477743qtb.30.1705992326098; Mon, 22 Jan 2024 22:45:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705992326; cv=pass; d=google.com; s=arc-20160816; b=lThGPUwfInQVy9m1+qN3GKJZ84499Jnm1znob2OcTKsF82rqucik9cxrjJsGMbYz2Y oll6UMGJ04Jcffeo49x3JeXvcOAWxIgQd2C/6qeEDDVAbWbUlXCQWT3VqbaGoy28FLJy Cz1oH7ZPc3W9vuPqFk4PErHmUq5RzzXGo1GY/c+nxv+/qS3VxyJ3T0aJ6J9tlv9Wl3dw qKaDN3UjZjcw20UVG8TVb5QaeVajBq+FQCh7cCC0/XWz+OlUOG9CrE2KExLkZkneKBkH mR5AsFCGUq3PwuLOcW1I9/dPQEN7Lb+LEvCM2W9soqfgTh/U30QjFtGrHghuXpxY+k61 hEAw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=QGggBtFpqTIcqqUM1GHckHxxocPp9pQsG5tbw0ok28c=; fh=ChXOctppJn0KECDRINafwUY5xHRufGHaa0Ju9pddrcQ=; b=evV+m25n9shWmxDl1hAx5uc1PXvRMhcq2rOgQOMK7tUrak33NHIChRzK4R3fUzU5q+ Ouwjx5zk9BadmS8Yrz8VdmBcmNySNsRkl79OwD8oLfmpmRVyPDbwB6d8vRYkSC5dnM19 BOaLhLfpgdxQJSBts+2WeDPXgTVyWV1rEsYHh+rt/KQlLbhIhhOXJQKQBgCdLkdVtD6Q lLrFRzrpWIRSt8VQcffl2kgY0hDPAvCszWzedF2BWJ7tEVtawWD5Jh0yqpFGbDXp+t3U pcsiRyI66LNDnpRLKf/EiUF4L2mfFsnwjWo0Q1WfdtCznjt5PJq/zaF4uQ7+I/Lm8nKQ JjIg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=c+ih+m17; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id d12-20020ac85d8c000000b0042a1be95af3si7356792qtx.672.2024.01.22.22.45.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 22:45:26 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=c+ih+m17; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CBB853858436 for ; Tue, 23 Jan 2024 06:45:25 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) by sourceware.org (Postfix) with ESMTPS id 43F9F3858D20 for ; Tue, 23 Jan 2024 06:44:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 43F9F3858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 43F9F3858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=192.198.163.11 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705992281; cv=none; b=bSs7Yp3vIGiDm0v3e75oIGIXnV1EHaaNY0yOsnzR7vCBjmpwO76rjsQh3vpqjGZDO/eV9xZohcJ4/pTEnVYhsHILSfvtR89PX8l1aghAxCmgIT3n8gqEylsbD6fZVX+qu9F3FlFcjolQdvrOy9+1qsPw8P6+PcNBKNXdqj3m544= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705992281; c=relaxed/simple; bh=qElxfzHjIR4fZmFoNQfDKrj5YtI74pqXfrhAXiuPI0A=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=iT025a0fPU1bhhTsqm4Gcqk41EvbmTrOrQf7gIRZTgk8k+KYeAuSohT7q/RbwDqnZsjYC7q/CDPYAag+P+w4PA7+THCTDSbNSpdMgz3GDKfkMi+jKoHITMtBEyT5dWJTfnmgrmS0cFWF80us4VG3hnJz0tS0ByogBqdfeM9GeJw= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1705992280; x=1737528280; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=qElxfzHjIR4fZmFoNQfDKrj5YtI74pqXfrhAXiuPI0A=; b=c+ih+m17Mw5QIYwptTnXa6CnDsjR6OlRmU80q02nGcKmYx/l/chL4f+U D8ApJs1P1+PTDGxr+g9HrmakJFdJtOtPjMOHyYd5VtnnRbNZdoN5LRxR4 JX9v/HyGFxCD+xtXak+DokrvDdRINgobBXkiT56C/+Je4RuCmQrlylPZ5 da1j/6qHJvAT2zVOdki9dPNMsm0ZYrz7PZ7nfAsIXUHcn730ODy7qAV6K o7K2Ytg18G74v7+eFdmQ1Pgi5h+DOyyQuygh/W8jqR2Arh1ETNDdE0hAo Zd83Y1VkTM6mT5qWltVIMb4LTKF4KGXyMDi+auI8NNz8KTbDhbRNO91uF Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10961"; a="8103215" X-IronPort-AV: E=Sophos;i="6.05,213,1701158400"; d="scan'208";a="8103215" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jan 2024 22:44:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,213,1701158400"; d="scan'208";a="1486204" Received: from shvmail03.sh.intel.com ([10.239.245.20]) by orviesa003.jf.intel.com with ESMTP; 22 Jan 2024 22:44:38 -0800 Received: from shliclel4217.sh.intel.com (shliclel4217.sh.intel.com [10.239.240.127]) by shvmail03.sh.intel.com (Postfix) with ESMTP id 57F4910056FA; Tue, 23 Jan 2024 14:44:36 +0800 (CST) From: liuhongt To: gcc-patches@gcc.gnu.org Cc: crazylht@gmail.com, hjl.tools@gmail.com Subject: [PATCH 2/2] [x86] Enable -mlam=u57 by default when compiled with -fsanitize=hwaddress. Date: Tue, 23 Jan 2024 14:42:36 +0800 Message-Id: <20240123064236.1827190-2-hongtao.liu@intel.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20240123064236.1827190-1-hongtao.liu@intel.com> References: <20240123064236.1827190-1-hongtao.liu@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788862609070855369 X-GMAIL-MSGID: 1788862609070855369 Ready push to trunk. gcc/ChangeLog: * config/i386/i386-options.cc (ix86_option_override_internal): Enable -mlam=u57 by default when compiled with -fsanitize=hwaddress. --- gcc/config/i386/i386-options.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gcc/config/i386/i386-options.cc b/gcc/config/i386/i386-options.cc index b6f634e9a32..e66a58ed926 100644 --- a/gcc/config/i386/i386-options.cc +++ b/gcc/config/i386/i386-options.cc @@ -2189,6 +2189,15 @@ ix86_option_override_internal (bool main_args_p, && opts->x_ix86_abi != DEFAULT_ABI) error ("%<-mabi=%s%> not supported with %<-fsanitize=thread%>", abi_name); + /* Hwasan is supported with lam_u57 only. */ + if (opts->x_flag_sanitize & SANITIZE_HWADDRESS) + { + if (ix86_lam_type == lam_u48) + warning (0, "%<-mlam=u48%> is not compatible with Hardware-assisted " + "AddressSanitizer, override to %<-mlam=u57%>"); + ix86_lam_type = lam_u57; + } + /* For targets using ms ABI enable ms-extensions, if not explicit turned off. For non-ms ABI we turn off this option. */