Message ID | 20231206131228.2227335-1-lili.cui@intel.com |
---|---|
State | Accepted |
Headers |
Return-Path: <binutils-bounces+ouuuleilei=gmail.com@sourceware.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp4093779vqy; Wed, 6 Dec 2023 05:12:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IE+Rpiu0tB+E5Iip+xYW0+gWdvI6c+iRyRk8YhhVzDbck04ebsp+fxIKbxwJages6CxA7lv X-Received: by 2002:a05:6808:bd6:b0:3b8:b6f6:4f6d with SMTP id o22-20020a0568080bd600b003b8b6f64f6dmr1087356oik.5.1701868359987; Wed, 06 Dec 2023 05:12:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1701868359; cv=pass; d=google.com; s=arc-20160816; b=Hm/cCcRIyOOM/8xo2gClpfOTZE2t80fJdrxmH3dJ1+uCsoslecs1bGivHp9BPs5nOu qIV3Lc3sD6SmLxIbnvHeMCqjd+jR8ohAfPW0mC9oiLtaY9q048ESzPONdqPFe+Scqhm7 8MSW/0owVnayThV/LbbIo7ygJvIzaEr0Lc0UKXkdDPz+lA+xmHZvPFVhVfmRZgp90c1D /1l2LzEom+rZHaTSnmj5WjsEcx7Kj7bJMChhCB3U1qjNBQUDVFZxxzKYlNGnHhJ+7e5H Jq5Jr+C2PoihVV/X5ZJcqDVS73gKlGOnQPQKANu1F3X9aa2+xO0J9LY4qz/BzinoYKcS W1DQ== 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:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=zsU+OveqNpwNER9AkCnDqPocRbiqQqDDdZdBITBqAwE=; fh=ohjlW8amWAkl3RFBwC5ojAZtif/RVDQZdYLiyUWJyq8=; b=oEuJg9GY+QMh/E5+zKih8Fc+UNOhVl5MU5nOLq12JPO1IQ35I8zAOnIS/5zFf/dUHF tv9CCwZLHW2vjRNjQdMox+MbDoP960YoJR10M4NzhSGmzedCkOPZQwoDDxzyBKZdUxw7 XLnTjmOkNiQLapghQGR42+M/FjcRamh6F9hzDv1bxTQcVbBKrLHMO9kdENiZMFNOIauu 2MavN5MKE5I6jBA22czPlyi1phU4q4CIrVqcaGs1XhpqiHoxrPDad02oVezXmjuT+gXb BJAo1qf3h/LhJfr8jokaPJUwhv6ljUzhj0BoghJKBw1uqAMb96S05geFdRVtL1hiI51e SmNw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=mq6HpzdD; arc=pass (i=1); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id f8-20020a67cf48000000b00465d31fbcedsi588308vsm.488.2023.12.06.05.12.39 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 05:12:39 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=mq6HpzdD; arc=pass (i=1); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.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 2B0DF3858C56 for <ouuuleilei@gmail.com>; Wed, 6 Dec 2023 13:12:39 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) by sourceware.org (Postfix) with ESMTPS id B78363858D38 for <binutils@sourceware.org>; Wed, 6 Dec 2023 13:12:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B78363858D38 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 B78363858D38 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=192.198.163.9 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701868354; cv=none; b=pR1BevsdxuqXQuOo1W3LABZMhPqOOkdO8/+24zDsiWb1rE/IMhKooJBTxlR6SLdB4NTMuNScC9IBoHvA72YdovJ1fkYHO3M4AIYAvV8bnTpee/jOWhQUNyQ6IXEGmppvOvDjUglSsQf/oKbxxWQZ75Znu89PFpcXysqkvc9G3cI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701868354; c=relaxed/simple; bh=AwAA3N2evIujPgp5II+j4FfkqIpuOlooMs8t7CKGtDw=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=ngtJiuZQdnGgot3BAy1Bzz5Nw3gaTUHQXF8czfLLTLBkFPYhhK7Pp5sP7sxhFXhXPq30KCdM1ePH3T6sr7Ru9exhdKzA9P4cs7HZGqvT9LYNk6+YRUP60hoj272fdi3Maai8hBHKPOPW144iljDVq4UqAdy5i8YTwUeYVIVV96c= 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=1701868353; x=1733404353; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=AwAA3N2evIujPgp5II+j4FfkqIpuOlooMs8t7CKGtDw=; b=mq6HpzdDT1hevvH/xXV9qpaVw0Ss1xQvlfU5YQVfB/d9z8gXOU3gfnoV y0/CrPpVWjBPXrdmS6ouQpvF6mhreU+8tN1kDjMjYGu5Z3FwtI3C4U30K VWp5HuobM1BOCzovuDmgbeqOj3r9r/zGD3R1kYBRZBcMtvycUdPqIX7Vo gKob8GVgBWKxrokrtq9Z4UfVzoa1eEossf63maxgs7i8d711aa7hsfE+R R9KFLcBdeyvf92sHg7pbXDmLXIGXxk5/Sm/tpr+o5P+d28jxqU+cRziyX 5E62IOWGTElqmaaRtCe3AWFx4dbX2HAmgKzBQl7h5ATlgv9WX5gwjME2m g==; X-IronPort-AV: E=McAfee;i="6600,9927,10915"; a="944855" X-IronPort-AV: E=Sophos;i="6.04,255,1695711600"; d="scan'208";a="944855" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Dec 2023 05:12:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10915"; a="837321933" X-IronPort-AV: E=Sophos;i="6.04,255,1695711600"; d="scan'208";a="837321933" Received: from scymds03.sc.intel.com ([10.148.94.166]) by fmsmga008.fm.intel.com with ESMTP; 06 Dec 2023 05:12:31 -0800 Received: from shgcc101.sh.intel.com (shgcc101.sh.intel.com [10.239.85.97]) by scymds03.sc.intel.com (Postfix) with ESMTP id 38BFB15A; Wed, 6 Dec 2023 05:12:30 -0800 (PST) From: "Cui, Lili" <lili.cui@intel.com> To: binutils@sourceware.org Cc: jbeulich@suse.com, hongjiu.lu@intel.com Subject: [PATCH] Clean reg class and base_reg for input output operand (%dx). Date: Wed, 6 Dec 2023 13:12:28 +0000 Message-Id: <20231206131228.2227335-1-lili.cui@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.4 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: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list <binutils.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/binutils>, <mailto:binutils-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/binutils/> List-Post: <mailto:binutils@sourceware.org> List-Help: <mailto:binutils-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/binutils>, <mailto:binutils-request@sourceware.org?subject=subscribe> Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784538317562473050 X-GMAIL-MSGID: 1784538317562473050 |
Series |
Clean reg class and base_reg for input output operand (%dx).
|
|
Checks
Context | Check | Description |
---|---|---|
snail/binutils-gdb-check | success | Github commit url |
Commit Message
Cui, Lili
Dec. 6, 2023, 1:12 p.m. UTC
This patch is to clean reg class and base_reg for input output operand (%dx). For special processing of input and output operands (%dx), the state of some variables needs to be cleared. gas/ChangeLog: * config/tc-i386.c (i386_att_operand): Clean reg class and i.base_reg for input output operand (%dx). --- gas/config/tc-i386.c | 2 ++ 1 file changed, 2 insertions(+)
Comments
On 06.12.2023 14:12, Cui, Lili wrote: > --- a/gas/config/tc-i386.c > +++ b/gas/config/tc-i386.c > @@ -13016,6 +13016,8 @@ i386_att_operand (char *operand_string) > && !operand_type_check (i.types[this_operand], disp)) > { > i.types[this_operand] = i.base_reg->reg_type; > + i.types[this_operand].bitfield.class = 0; > + i.base_reg = NULL; I agree with the latter, but I don't understand the former. The more that in earlier discussion on the APX subthread I clearly indicated what I think needs doing here. Jan
> On 06.12.2023 14:12, Cui, Lili wrote: > > --- a/gas/config/tc-i386.c > > +++ b/gas/config/tc-i386.c > > @@ -13016,6 +13016,8 @@ i386_att_operand (char *operand_string) > > && !operand_type_check (i.types[this_operand], disp)) > > { > > i.types[this_operand] = i.base_reg->reg_type; > > + i.types[this_operand].bitfield.class = 0; > > + i.base_reg = NULL; > > I agree with the latter, but I don't understand the former. The more that in > earlier discussion on the APX subthread I clearly indicated what I think needs > doing here. > The original issue was that we encountered a segment fault when accessing i.op[op].regs->reg_flags, and since the input was (%dx), we treat it as memory, so I think we need to clean up i.types[this_operand]. bitfield.class = 0 and leave i.base_reg there, it means i.base_reg does not need to be cleaned. Lili.
On 07.12.2023 09:48, Cui, Lili wrote: >> On 06.12.2023 14:12, Cui, Lili wrote: >>> --- a/gas/config/tc-i386.c >>> +++ b/gas/config/tc-i386.c >>> @@ -13016,6 +13016,8 @@ i386_att_operand (char *operand_string) >>> && !operand_type_check (i.types[this_operand], disp)) >>> { >>> i.types[this_operand] = i.base_reg->reg_type; >>> + i.types[this_operand].bitfield.class = 0; >>> + i.base_reg = NULL; >> >> I agree with the latter, but I don't understand the former. The more that in >> earlier discussion on the APX subthread I clearly indicated what I think needs >> doing here. >> > > The original issue was that we encountered a segment fault when accessing i.op[op].regs->reg_flags, and since the input was (%dx), we treat it as memory, so I think we need to clean up i.types[this_operand]. bitfield.class = 0 and leave i.base_reg there, it means i.base_reg does not need to be cleaned. As said before - what is missing as far as I understand it is the updating of i.op[].regs in the code above. That ought to be (much) preferred over invalidating .class (and thus perhaps causing new latent issues). Jan
> >>> --- a/gas/config/tc-i386.c > >>> +++ b/gas/config/tc-i386.c > >>> @@ -13016,6 +13016,8 @@ i386_att_operand (char *operand_string) > >>> && !operand_type_check (i.types[this_operand], disp)) > >>> { > >>> i.types[this_operand] = i.base_reg->reg_type; > >>> + i.types[this_operand].bitfield.class = 0; > >>> + i.base_reg = NULL; > >> > >> I agree with the latter, but I don't understand the former. The more > >> that in earlier discussion on the APX subthread I clearly indicated > >> what I think needs doing here. > >> > > > > The original issue was that we encountered a segment fault when accessing > i.op[op].regs->reg_flags, and since the input was (%dx), we treat it as > memory, so I think we need to clean up i.types[this_operand]. bitfield.class = > 0 and leave i.base_reg there, it means i.base_reg does not need to be > cleaned. > > As said before - what is missing as far as I understand it is the updating of > i.op[].regs in the code above. That ought to be (much) preferred over > invalidating .class (and thus perhaps causing new latent issues). > Changed. Can I check in this patch ? Clean base_reg and assign correct values to regs for input_output_operand (%dx). For special processing of input and output operands (%dx), the state of some variables needs to be cleaned. gas/ChangeLog: * config/tc-i386.c (i386_att_operand): Assign values to regs and clean i.base_reg for input output operand (%dx). diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 4f3864f2ba7..3f1b39baddc 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -13016,6 +13016,8 @@ i386_att_operand (char *operand_string) && !operand_type_check (i.types[this_operand], disp)) { i.types[this_operand] = i.base_reg->reg_type; + i.op[this_operand].regs = i.base_reg; + i.base_reg = NULL; i.input_output_operand = true; return 1; } Thanks, Lili.
On 12.12.2023 08:51, Cui, Lili wrote: >>>>> --- a/gas/config/tc-i386.c >>>>> +++ b/gas/config/tc-i386.c >>>>> @@ -13016,6 +13016,8 @@ i386_att_operand (char *operand_string) >>>>> && !operand_type_check (i.types[this_operand], disp)) >>>>> { >>>>> i.types[this_operand] = i.base_reg->reg_type; >>>>> + i.types[this_operand].bitfield.class = 0; >>>>> + i.base_reg = NULL; >>>> >>>> I agree with the latter, but I don't understand the former. The more >>>> that in earlier discussion on the APX subthread I clearly indicated >>>> what I think needs doing here. >>>> >>> >>> The original issue was that we encountered a segment fault when accessing >> i.op[op].regs->reg_flags, and since the input was (%dx), we treat it as >> memory, so I think we need to clean up i.types[this_operand]. bitfield.class = >> 0 and leave i.base_reg there, it means i.base_reg does not need to be >> cleaned. >> >> As said before - what is missing as far as I understand it is the updating of >> i.op[].regs in the code above. That ought to be (much) preferred over >> invalidating .class (and thus perhaps causing new latent issues). >> > > Changed. Can I check in this patch ? If the change is enough to avoid any respective oddities in the APX patches, then yes, please go ahead. Jan > Clean base_reg and assign correct values to regs for input_output_operand (%dx). > > For special processing of input and output operands (%dx), > the state of some variables needs to be cleaned. > > gas/ChangeLog: > > * config/tc-i386.c (i386_att_operand): Assign values to regs and > clean i.base_reg for input output operand (%dx). > > diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c > index 4f3864f2ba7..3f1b39baddc 100644 > --- a/gas/config/tc-i386.c > +++ b/gas/config/tc-i386.c > @@ -13016,6 +13016,8 @@ i386_att_operand (char *operand_string) > && !operand_type_check (i.types[this_operand], disp)) > { > i.types[this_operand] = i.base_reg->reg_type; > + i.op[this_operand].regs = i.base_reg; > + i.base_reg = NULL; > i.input_output_operand = true; > return 1; > } > > Thanks, > Lili.
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 4f3864f2ba7..ffb2f14c4ec 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -13016,6 +13016,8 @@ i386_att_operand (char *operand_string) && !operand_type_check (i.types[this_operand], disp)) { i.types[this_operand] = i.base_reg->reg_type; + i.types[this_operand].bitfield.class = 0; + i.base_reg = NULL; i.input_output_operand = true; return 1; }