The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
	linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
	jmattson@google.com, peterx@redhat.com
Cc: kbuild-all@lists.01.org, jmattson@google.com
Subject: Re: [PATCH] KVM: x86: fix DR6 delivery for emulated hardware breakpoint
Date: Wed, 6 May 2020 08:33:38 +0800	[thread overview]
Message-ID: <202005060834.lFYtLSoK%lkp@intel.com> (raw)
In-Reply-To: <20200505113449.18478-1-pbonzini@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 3791 bytes --]

Hi Paolo,

I love your patch! Yet something to improve:

[auto build test ERROR on kvm/linux-next]
[also build test ERROR on tip/auto-latest linus/master v5.7-rc4 next-20200505]
[cannot apply to linux/master]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Paolo-Bonzini/KVM-x86-fix-DR6-delivery-for-emulated-hardware-breakpoint/20200506-043817
base:   https://git.kernel.org/pub/scm/virt/kvm/kvm.git linux-next
config: i386-allyesconfig (attached as .config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>

All error/warnings (new ones prefixed by >>):

   arch/x86/kvm/x86.c: In function 'kvm_deliver_exception_payload':
>> arch/x86/kvm/x86.c:472:3: error: implicit declaration of function 'kvm_update_dr6'; did you mean 'kvm_update_cpuid'? [-Werror=implicit-function-declaration]
      kvm_update_dr6(vcpu);
      ^~~~~~~~~~~~~~
      kvm_update_cpuid
   arch/x86/kvm/x86.c: At top level:
>> arch/x86/kvm/x86.c:1071:13: warning: conflicting types for 'kvm_update_dr6'
    static void kvm_update_dr6(struct kvm_vcpu *vcpu)
                ^~~~~~~~~~~~~~
>> arch/x86/kvm/x86.c:1071:13: error: static declaration of 'kvm_update_dr6' follows non-static declaration
   arch/x86/kvm/x86.c:472:3: note: previous implicit declaration of 'kvm_update_dr6' was here
      kvm_update_dr6(vcpu);
      ^~~~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +472 arch/x86/kvm/x86.c

   432	
   433	void kvm_deliver_exception_payload(struct kvm_vcpu *vcpu)
   434	{
   435		unsigned nr = vcpu->arch.exception.nr;
   436		bool has_payload = vcpu->arch.exception.has_payload;
   437		unsigned long payload = vcpu->arch.exception.payload;
   438	
   439		if (!has_payload)
   440			return;
   441	
   442		switch (nr) {
   443		case DB_VECTOR:
   444			/*
   445			 * "Certain debug exceptions may clear bit 0-3.  The
   446			 * remaining contents of the DR6 register are never
   447			 * cleared by the processor".
   448			 */
   449			vcpu->arch.dr6 &= ~DR_TRAP_BITS;
   450			/*
   451			 * DR6.RTM is set by all #DB exceptions that don't clear it.
   452			 */
   453			vcpu->arch.dr6 |= DR6_RTM;
   454			vcpu->arch.dr6 |= payload;
   455			/*
   456			 * Bit 16 should be set in the payload whenever the #DB
   457			 * exception should clear DR6.RTM. This makes the payload
   458			 * compatible with the pending debug exceptions under VMX.
   459			 * Though not currently documented in the SDM, this also
   460			 * makes the payload compatible with the exit qualification
   461			 * for #DB exceptions under VMX.
   462			 */
   463			vcpu->arch.dr6 ^= payload & DR6_RTM;
   464	
   465			/*
   466			 * The #DB payload is defined as compatible with the 'pending
   467			 * debug exceptions' field under VMX, not DR6. While bit 12 is
   468			 * defined in the 'pending debug exceptions' field (enabled
   469			 * breakpoint), it is reserved and must be zero in DR6.
   470			 */
   471			vcpu->arch.dr6 &= ~BIT(12);
 > 472			kvm_update_dr6(vcpu);
   473			break;
   474		case PF_VECTOR:
   475			vcpu->arch.cr2 = payload;
   476			break;
   477		}
   478	
   479		vcpu->arch.exception.has_payload = false;
   480		vcpu->arch.exception.payload = 0;
   481	}
   482	EXPORT_SYMBOL_GPL(kvm_deliver_exception_payload);
   483	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 71662 bytes --]

      parent reply	other threads:[~2020-05-06  1:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-05 11:34 [PATCH] KVM: x86: fix DR6 delivery for emulated hardware breakpoint Paolo Bonzini
2020-05-05 14:15 ` Peter Xu
2020-05-06  0:33 ` kbuild test robot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202005060834.lFYtLSoK%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=jmattson@google.com \
    --cc=kbuild-all@lists.01.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox