[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2 2/7] xen/x86: merge 2 hvm_event_... functions into 1


  • To: Jan Beulich <JBeulich@xxxxxxxx>
  • From: Corneliu ZUZU <czuzu@xxxxxxxxxxxxxxx>
  • Date: Wed, 10 Feb 2016 19:04:18 +0200
  • Cc: Kevin Tian <kevin.tian@xxxxxxxxx>, Tamas K Lengyel <tamas@xxxxxxxxxxxxx>, Keir Fraser <keir@xxxxxxx>, Razvan Cojocaru <rcojocaru@xxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxx, Jun Nakajima <jun.nakajima@xxxxxxxxx>
  • Comment: DomainKeys? See http://domainkeys.sourceforge.net/
  • Delivery-date: Wed, 10 Feb 2016 17:04:25 +0000
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=bitdefender.com; b=qVavcsyogRKno3QN2vNfXhskCQCf/dBR6265o8w0vwysFOEfYeiPpMvqETWUBYgBoHD6cTVbsBoClAptYh60k2CZRmO3Sx3FPMIeELq+4hfImg0bPd3cvBhHqLgd57h8M8GUPi11djd5gH3wPe6H5Cqpm8bxLRk1Ev4SnN+1M+mtOssKtdoBk/Yr0Fs4Scurnz6ztZNEmJtrx1701rJWxMuIXzYGerMdVcJbcJZz2odjjfVCR4vmh6vVm3e/zgQOC8F749X1pR77q3qUgTRX7ZQHFKp5akI+JIE2XWqlRTx/SSDAymkBektAJOcOkLnHExyjuOKN1x81bNFLvoFlcg==; h=Received:Received:Received:Received:Received:Subject:To:References:Cc:From:Message-ID:Date:User-Agent:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding:X-BitDefender-Scanner:X-BitDefender-Spam:X-BitDefender-SpamStamp:X-BitDefender-CF-Stamp;
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>

On 2/10/2016 6:18 PM, Jan Beulich wrote:
On 10.02.16 at 16:50, <czuzu@xxxxxxxxxxxxxxx> wrote:
@@ -151,61 +154,52 @@ void hvm_event_guest_request(void)
      }
  }
-int hvm_event_int3(unsigned long rip)
+static inline
+uint64_t gfn_of_rip(unsigned long rip)
This should be a single line and the return value should be
unsigned long.
Noted.
+    return (uint64_t) paging_gva_to_gfn(curr, sreg.base + rip, &pfec);
  }
Pointless cast.
Noted.

--- a/xen/include/asm-x86/hvm/event.h
+++ b/xen/include/asm-x86/hvm/event.h
@@ -17,6 +17,12 @@
  #ifndef __ASM_X86_HVM_EVENT_H__
  #define __ASM_X86_HVM_EVENT_H__
+enum hvm_event_breakpoint_type
+{
+    HVM_EVENT_SOFTWARE_BREAKPOINT,
+    HVM_EVENT_SINGLESTEP_BREAKPOINT,
+};
I don't see what good it does to put existing constants into an
enum.
As Andrew pointed out, an enum was requested in v1 instead of the single_step param. One could use the already existing VM_EVENT_REASON_* constants, but conceptually this
function only involves a subset of those (i.e. *breakpoint vm-events*).

@@ -27,9 +33,8 @@ bool_t hvm_event_cr(unsigned int index, unsigned long value,
  #define hvm_event_crX(what, new, old) \
      hvm_event_cr(VM_EVENT_X86_##what, new, old)
  void hvm_event_msr(unsigned int msr, uint64_t value);
-/* Called for current VCPU: returns -1 if no listener */
-int hvm_event_int3(unsigned long rip);
-int hvm_event_single_step(unsigned long rip);
+int hvm_event_breakpoint(unsigned long rip,
+                         enum hvm_event_breakpoint_type type);
I guess the comment was here for a reason, and this reason doesn't
go away with this code folding. But I'll leave it to the VM event code
maintainers to judge.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


That comment seemed & still seems wrong to me, I don't see any code paths out of which that function would return -1.

Thank you,
Corneliu.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.